diff --git a/.chronus/changes/bump-cadl-ranch-2024-2024-8-5-17-18-29.md b/.chronus/changes/bump-cadl-ranch-2024-2024-8-5-17-18-29.md new file mode 100644 index 00000000000..d9ee1bfa66b --- /dev/null +++ b/.chronus/changes/bump-cadl-ranch-2024-2024-8-5-17-18-29.md @@ -0,0 +1,7 @@ +--- +changeKind: feature +packages: + - "@azure-tools/typespec-python" +--- + +Add support for `HttpPart<{@body body: XXX}>` of multipart \ No newline at end of file diff --git a/package.json b/package.json index c55995dcdd0..db8b8ce79dc 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "homepage": "https://github.com/Azure/autorest.python#readme", "devDependencies": { "@actions/github": "6.0.0", - "@azure-tools/cadl-ranch": "~0.14.2", + "@azure-tools/cadl-ranch": "~0.14.5", "@chronus/chronus": "^0.10.2", "@chronus/github": "^0.3.2", "@typespec/prettier-plugin-typespec": "~0.58.0", diff --git a/packages/typespec-python/generator/pygen/codegen/models/parameter.py b/packages/typespec-python/generator/pygen/codegen/models/parameter.py index 8c3df862172..81a6ebedd53 100644 --- a/packages/typespec-python/generator/pygen/codegen/models/parameter.py +++ b/packages/typespec-python/generator/pygen/codegen/models/parameter.py @@ -232,7 +232,11 @@ def entries(self) -> List["BodyParameter"]: def is_form_data(self) -> bool: # hacky, but rn in legacy, there is no formdata model type, it's just a dict # with all of the entries splatted out - return self.type.is_form_data or bool(self.entries) + return ( + self.type.is_form_data + or bool(self.entries) + or ("multipart/form-data" in self.content_types and self.code_model.options["from_typespec"]) + ) @property def is_partial_body(self) -> bool: diff --git a/packages/typespec-python/generator/pygen/codegen/serializers/test_serializer.py b/packages/typespec-python/generator/pygen/codegen/serializers/test_serializer.py index 345e8cd4c95..f6618787cf1 100644 --- a/packages/typespec-python/generator/pygen/codegen/serializers/test_serializer.py +++ b/packages/typespec-python/generator/pygen/codegen/serializers/test_serializer.py @@ -80,6 +80,12 @@ def __init__( self.operation = operation self.is_async = is_async + @property + def name(self) -> str: + if self.operation_groups[-1].is_mixin: + return self.operation.name + return "_".join([og.property_name for og in self.operation_groups] + [self.operation.name]) + @property def operation_group_prefix(self) -> str: if self.operation_groups[-1].is_mixin: diff --git a/packages/typespec-python/generator/pygen/codegen/templates/test.py.jinja2 b/packages/typespec-python/generator/pygen/codegen/templates/test.py.jinja2 index 73e7153f95c..25f8da7b539 100644 --- a/packages/typespec-python/generator/pygen/codegen/templates/test.py.jinja2 +++ b/packages/typespec-python/generator/pygen/codegen/templates/test.py.jinja2 @@ -29,9 +29,9 @@ class {{ test.test_class_name }}({{ test.base_test_class_name }}): {% endif %} @recorded_by_proxy{{ async_suffix }} {% if code_model.options["azure_arm"] %} - {{ async }}def test_{{ testcase.operation.name }}(self, resource_group): + {{ async }}def test_{{ testcase.name }}(self, resource_group): {% else %} - {{ async }}def test_{{ testcase.operation.name }}(self, {{ prefix_lower }}_endpoint): + {{ async }}def test_{{ testcase.name }}(self, {{ prefix_lower }}_endpoint): {{ client_var }} = self.{{ test.create_client_name }}(endpoint={{ prefix_lower }}_endpoint) {% endif %} {{testcase.response }}{{ client_var }}{{ testcase.operation_group_prefix }}.{{ testcase.operation.name }}( diff --git a/packages/typespec-python/package.json b/packages/typespec-python/package.json index d0ec2ac8a7d..42682c208b9 100644 --- a/packages/typespec-python/package.json +++ b/packages/typespec-python/package.json @@ -65,8 +65,8 @@ "devDependencies": { "@azure-tools/typespec-azure-resource-manager": "~0.45.0", "@azure-tools/typespec-autorest": "~0.45.0", - "@azure-tools/cadl-ranch-expect": "~0.15.1", - "@azure-tools/cadl-ranch-specs": "~0.36.1", + "@azure-tools/cadl-ranch-expect": "~0.15.3", + "@azure-tools/cadl-ranch-specs": "~0.37.1", "@types/js-yaml": "~4.0.5", "@types/node": "^18.16.3", "@types/yargs": "17.0.32", diff --git a/packages/typespec-python/scripts/eng/regenerate.ts b/packages/typespec-python/scripts/eng/regenerate.ts index cf518fd5210..31f81d1ae8b 100644 --- a/packages/typespec-python/scripts/eng/regenerate.ts +++ b/packages/typespec-python/scripts/eng/regenerate.ts @@ -50,9 +50,6 @@ const EMITTER_OPTIONS: Record | Record( property: SdkBodyModelPropertyType, ): Record { const isMultipartFileInput = property.multipartOptions?.isFilePart; - const sourceType = isMultipartFileInput ? createMultiPartFileType(property.type) : property.type; + let sourceType: SdkType | MultiPartFileType = property.type; + if (isMultipartFileInput) { + sourceType = createMultiPartFileType(property.type); + } else if (property.type.kind === "model") { + const body = property.type.properties.find((x) => x.kind === "body"); + if (body) { + // for `temperature: HttpPart<{@body body: float64, @header contentType: "text/plain"}>`, the real type is float64 + sourceType = body.type; + } + } if (isMultipartFileInput) { // Python convert all the type of file part to FileType so clear these models' usage so that they won't be generated addDisableGenerationMap(property.type); diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/generated_tests/test_access_public_operation_operations.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/generated_tests/test_access_public_operation_operations.py index 5d60f59e1b4..bf07380e8fa 100644 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/generated_tests/test_access_public_operation_operations.py +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/generated_tests/test_access_public_operation_operations.py @@ -14,7 +14,7 @@ class TestAccessPublicOperationOperations(AccessClientTestBase): @AccessPreparer() @recorded_by_proxy - def test_no_decorator_in_public(self, access_endpoint): + def test_public_operation_no_decorator_in_public(self, access_endpoint): client = self.create_client(endpoint=access_endpoint) response = client.public_operation.no_decorator_in_public( name="str", @@ -25,7 +25,7 @@ def test_no_decorator_in_public(self, access_endpoint): @AccessPreparer() @recorded_by_proxy - def test_public_decorator_in_public(self, access_endpoint): + def test_public_operation_public_decorator_in_public(self, access_endpoint): client = self.create_client(endpoint=access_endpoint) response = client.public_operation.public_decorator_in_public( name="str", diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/generated_tests/test_access_public_operation_operations_async.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/generated_tests/test_access_public_operation_operations_async.py index 3333d6ea5e4..2396a14d56f 100644 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/generated_tests/test_access_public_operation_operations_async.py +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/generated_tests/test_access_public_operation_operations_async.py @@ -15,7 +15,7 @@ class TestAccessPublicOperationOperationsAsync(AccessClientTestBaseAsync): @AccessPreparer() @recorded_by_proxy_async - async def test_no_decorator_in_public(self, access_endpoint): + async def test_public_operation_no_decorator_in_public(self, access_endpoint): client = self.create_async_client(endpoint=access_endpoint) response = await client.public_operation.no_decorator_in_public( name="str", @@ -26,7 +26,7 @@ async def test_no_decorator_in_public(self, access_endpoint): @AccessPreparer() @recorded_by_proxy_async - async def test_public_decorator_in_public(self, access_endpoint): + async def test_public_operation_public_decorator_in_public(self, access_endpoint): client = self.create_async_client(endpoint=access_endpoint) response = await client.public_operation.public_decorator_in_public( name="str", diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/generated_tests/test_access_shared_model_in_operation_operations.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/generated_tests/test_access_shared_model_in_operation_operations.py index be0c1dd4060..df2954375fd 100644 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/generated_tests/test_access_shared_model_in_operation_operations.py +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/generated_tests/test_access_shared_model_in_operation_operations.py @@ -14,7 +14,7 @@ class TestAccessSharedModelInOperationOperations(AccessClientTestBase): @AccessPreparer() @recorded_by_proxy - def test_public(self, access_endpoint): + def test_shared_model_in_operation_public(self, access_endpoint): client = self.create_client(endpoint=access_endpoint) response = client.shared_model_in_operation.public( name="str", diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/generated_tests/test_access_shared_model_in_operation_operations_async.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/generated_tests/test_access_shared_model_in_operation_operations_async.py index 4f872d110f9..a4ce11fd46b 100644 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/generated_tests/test_access_shared_model_in_operation_operations_async.py +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-access/generated_tests/test_access_shared_model_in_operation_operations_async.py @@ -15,7 +15,7 @@ class TestAccessSharedModelInOperationOperationsAsync(AccessClientTestBaseAsync): @AccessPreparer() @recorded_by_proxy_async - async def test_public(self, access_endpoint): + async def test_shared_model_in_operation_public(self, access_endpoint): client = self.create_async_client(endpoint=access_endpoint) response = await client.shared_model_in_operation.public( name="str", diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/MANIFEST.in b/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/MANIFEST.in index d62da5d21c7..4d1bfd40f79 100644 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/MANIFEST.in +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/MANIFEST.in @@ -1,8 +1,9 @@ include *.md include LICENSE -include azure/clientgenerator/core/flattenproperty/py.typed +include specs/azure/clientgenerator/core/flattenproperty/py.typed recursive-include tests *.py recursive-include samples *.py *.md -include azure/__init__.py -include azure/clientgenerator/__init__.py -include azure/clientgenerator/core/__init__.py \ No newline at end of file +include specs/__init__.py +include specs/azure/__init__.py +include specs/azure/clientgenerator/__init__.py +include specs/azure/clientgenerator/core/__init__.py \ No newline at end of file diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/README.md b/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/README.md index 9b8f6b32daa..3174317b475 100644 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/README.md +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/README.md @@ -1,6 +1,6 @@ -# Azure Clientgenerator Core Flattenproperty client library for Python +# Specs Azure Clientgenerator Core Flattenproperty client library for Python ## Getting started @@ -8,14 +8,14 @@ ### Install the package ```bash -python -m pip install azure-clientgenerator-core-flattenproperty +python -m pip install specs-azure-clientgenerator-core-flattenproperty ``` #### Prequisites - Python 3.8 or later is required to use this package. - You need an [Azure subscription][azure_sub] to use this package. -- An existing Azure Clientgenerator Core Flattenproperty instance. +- An existing Specs Azure Clientgenerator Core Flattenproperty instance. ## Contributing diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/apiview_mapping_python.json b/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/apiview_mapping_python.json index 8a4da25dc9a..97da5568b42 100644 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/apiview_mapping_python.json +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/apiview_mapping_python.json @@ -1,11 +1,11 @@ { - "CrossLanguagePackageId": "Azure.ClientGenerator.Core.FlattenProperty", + "CrossLanguagePackageId": "_Specs_.Azure.ClientGenerator.Core.FlattenProperty", "CrossLanguageDefinitionId": { - "azure.clientgenerator.core.flattenproperty.models.ChildFlattenModel": "Azure.ClientGenerator.Core.FlattenProperty.ChildFlattenModel", - "azure.clientgenerator.core.flattenproperty.models.ChildModel": "Azure.ClientGenerator.Core.FlattenProperty.ChildModel", - "azure.clientgenerator.core.flattenproperty.models.FlattenModel": "Azure.ClientGenerator.Core.FlattenProperty.FlattenModel", - "azure.clientgenerator.core.flattenproperty.models.NestedFlattenModel": "Azure.ClientGenerator.Core.FlattenProperty.NestedFlattenModel", - "azure.clientgenerator.core.flattenproperty.FlattenPropertyClient.put_flatten_model": "Azure.ClientGenerator.Core.FlattenProperty.putFlattenModel", - "azure.clientgenerator.core.flattenproperty.FlattenPropertyClient.put_nested_flatten_model": "Azure.ClientGenerator.Core.FlattenProperty.putNestedFlattenModel" + "specs.azure.clientgenerator.core.flattenproperty.models.ChildFlattenModel": "_Specs_.Azure.ClientGenerator.Core.FlattenProperty.ChildFlattenModel", + "specs.azure.clientgenerator.core.flattenproperty.models.ChildModel": "_Specs_.Azure.ClientGenerator.Core.FlattenProperty.ChildModel", + "specs.azure.clientgenerator.core.flattenproperty.models.FlattenModel": "_Specs_.Azure.ClientGenerator.Core.FlattenProperty.FlattenModel", + "specs.azure.clientgenerator.core.flattenproperty.models.NestedFlattenModel": "_Specs_.Azure.ClientGenerator.Core.FlattenProperty.NestedFlattenModel", + "specs.azure.clientgenerator.core.flattenproperty.FlattenPropertyClient.put_flatten_model": "_Specs_.Azure.ClientGenerator.Core.FlattenProperty.putFlattenModel", + "specs.azure.clientgenerator.core.flattenproperty.FlattenPropertyClient.put_nested_flatten_model": "_Specs_.Azure.ClientGenerator.Core.FlattenProperty.putNestedFlattenModel" } } \ No newline at end of file diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/generated_tests/testpreparer.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/generated_tests/testpreparer.py index 76878b59eba..739c5ff2de4 100644 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/generated_tests/testpreparer.py +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/generated_tests/testpreparer.py @@ -5,9 +5,9 @@ # Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from azure.clientgenerator.core.flattenproperty import FlattenPropertyClient from devtools_testutils import AzureRecordedTestCase, PowerShellPreparer import functools +from specs.azure.clientgenerator.core.flattenproperty import FlattenPropertyClient class FlattenPropertyClientTestBase(AzureRecordedTestCase): diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/generated_tests/testpreparer_async.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/generated_tests/testpreparer_async.py index 306e9f1726f..f66cc7610b9 100644 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/generated_tests/testpreparer_async.py +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/generated_tests/testpreparer_async.py @@ -5,8 +5,8 @@ # Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from azure.clientgenerator.core.flattenproperty.aio import FlattenPropertyClient from devtools_testutils import AzureRecordedTestCase +from specs.azure.clientgenerator.core.flattenproperty.aio import FlattenPropertyClient class FlattenPropertyClientTestBaseAsync(AzureRecordedTestCase): diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/setup.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/setup.py index f8c5223d9a6..9569a683c2f 100644 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/setup.py +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/setup.py @@ -12,8 +12,8 @@ from setuptools import setup, find_packages -PACKAGE_NAME = "azure-clientgenerator-core-flattenproperty" -PACKAGE_PPRINT_NAME = "Azure Clientgenerator Core Flattenproperty" +PACKAGE_NAME = "specs-azure-clientgenerator-core-flattenproperty" +PACKAGE_PPRINT_NAME = "Specs Azure Clientgenerator Core Flattenproperty" # a-b-c => a/b/c package_folder_path = PACKAGE_NAME.replace("-", "/") @@ -54,14 +54,15 @@ exclude=[ "tests", # Exclude packages that will be covered by PEP420 or nspkg - "azure", - "azure.clientgenerator", - "azure.clientgenerator.core", + "specs", + "specs.azure", + "specs.azure.clientgenerator", + "specs.azure.clientgenerator.core", ] ), include_package_data=True, package_data={ - "azure.clientgenerator.core.flattenproperty": ["py.typed"], + "specs.azure.clientgenerator.core.flattenproperty": ["py.typed"], }, install_requires=[ "isodate>=0.6.1", diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/azure/__init__.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/specs/__init__.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/azure/__init__.py rename to packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/specs/__init__.py diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/azure/clientgenerator/__init__.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/specs/azure/__init__.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/azure/clientgenerator/__init__.py rename to packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/specs/azure/__init__.py diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/azure/clientgenerator/core/__init__.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/specs/azure/clientgenerator/__init__.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/azure/clientgenerator/core/__init__.py rename to packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/specs/azure/clientgenerator/__init__.py diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/specs/azure/clientgenerator/core/__init__.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/specs/azure/clientgenerator/core/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/specs/azure/clientgenerator/core/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/azure/clientgenerator/core/flattenproperty/__init__.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/specs/azure/clientgenerator/core/flattenproperty/__init__.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/azure/clientgenerator/core/flattenproperty/__init__.py rename to packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/specs/azure/clientgenerator/core/flattenproperty/__init__.py diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/azure/clientgenerator/core/flattenproperty/_client.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/specs/azure/clientgenerator/core/flattenproperty/_client.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/azure/clientgenerator/core/flattenproperty/_client.py rename to packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/specs/azure/clientgenerator/core/flattenproperty/_client.py diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/azure/clientgenerator/core/flattenproperty/_configuration.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/specs/azure/clientgenerator/core/flattenproperty/_configuration.py similarity index 94% rename from packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/azure/clientgenerator/core/flattenproperty/_configuration.py rename to packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/specs/azure/clientgenerator/core/flattenproperty/_configuration.py index 24ed4551117..2dd1ae8fc4f 100644 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/azure/clientgenerator/core/flattenproperty/_configuration.py +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/specs/azure/clientgenerator/core/flattenproperty/_configuration.py @@ -26,7 +26,7 @@ class FlattenPropertyClientConfiguration: # pylint: disable=too-many-instance-a def __init__(self, endpoint: str = "http://localhost:3000", **kwargs: Any) -> None: self.endpoint = endpoint - kwargs.setdefault("sdk_moniker", "clientgenerator-core-flattenproperty/{}".format(VERSION)) + kwargs.setdefault("sdk_moniker", "specs-azure-clientgenerator-core-flattenproperty/{}".format(VERSION)) self.polling_interval = kwargs.get("polling_interval", 30) self._configure(**kwargs) diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/azure/clientgenerator/core/flattenproperty/_model_base.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/specs/azure/clientgenerator/core/flattenproperty/_model_base.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/azure/clientgenerator/core/flattenproperty/_model_base.py rename to packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/specs/azure/clientgenerator/core/flattenproperty/_model_base.py diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/azure/clientgenerator/core/flattenproperty/_operations/__init__.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/specs/azure/clientgenerator/core/flattenproperty/_operations/__init__.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/azure/clientgenerator/core/flattenproperty/_operations/__init__.py rename to packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/specs/azure/clientgenerator/core/flattenproperty/_operations/__init__.py diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/azure/clientgenerator/core/flattenproperty/_operations/_operations.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/specs/azure/clientgenerator/core/flattenproperty/_operations/_operations.py similarity index 91% rename from packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/azure/clientgenerator/core/flattenproperty/_operations/_operations.py rename to packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/specs/azure/clientgenerator/core/flattenproperty/_operations/_operations.py index 6fd86b679ea..90e8d3a2271 100644 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/azure/clientgenerator/core/flattenproperty/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/specs/azure/clientgenerator/core/flattenproperty/_operations/_operations.py @@ -88,12 +88,12 @@ def put_flatten_model( """put_flatten_model. :param input: Required. - :type input: ~azure.clientgenerator.core.flattenproperty.models.FlattenModel + :type input: ~specs.azure.clientgenerator.core.flattenproperty.models.FlattenModel :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: FlattenModel. The FlattenModel is compatible with MutableMapping - :rtype: ~azure.clientgenerator.core.flattenproperty.models.FlattenModel + :rtype: ~specs.azure.clientgenerator.core.flattenproperty.models.FlattenModel :raises ~azure.core.exceptions.HttpResponseError: """ @@ -109,7 +109,7 @@ def put_flatten_model( Default value is "application/json". :paramtype content_type: str :return: FlattenModel. The FlattenModel is compatible with MutableMapping - :rtype: ~azure.clientgenerator.core.flattenproperty.models.FlattenModel + :rtype: ~specs.azure.clientgenerator.core.flattenproperty.models.FlattenModel :raises ~azure.core.exceptions.HttpResponseError: """ @@ -125,7 +125,7 @@ def put_flatten_model( Default value is "application/json". :paramtype content_type: str :return: FlattenModel. The FlattenModel is compatible with MutableMapping - :rtype: ~azure.clientgenerator.core.flattenproperty.models.FlattenModel + :rtype: ~specs.azure.clientgenerator.core.flattenproperty.models.FlattenModel :raises ~azure.core.exceptions.HttpResponseError: """ @@ -136,10 +136,10 @@ def put_flatten_model( """put_flatten_model. :param input: Is one of the following types: FlattenModel, JSON, IO[bytes] Required. - :type input: ~azure.clientgenerator.core.flattenproperty.models.FlattenModel or JSON or + :type input: ~specs.azure.clientgenerator.core.flattenproperty.models.FlattenModel or JSON or IO[bytes] :return: FlattenModel. The FlattenModel is compatible with MutableMapping - :rtype: ~azure.clientgenerator.core.flattenproperty.models.FlattenModel + :rtype: ~specs.azure.clientgenerator.core.flattenproperty.models.FlattenModel :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping[int, Type[HttpResponseError]] = { @@ -207,12 +207,12 @@ def put_nested_flatten_model( """put_nested_flatten_model. :param input: Required. - :type input: ~azure.clientgenerator.core.flattenproperty.models.NestedFlattenModel + :type input: ~specs.azure.clientgenerator.core.flattenproperty.models.NestedFlattenModel :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: NestedFlattenModel. The NestedFlattenModel is compatible with MutableMapping - :rtype: ~azure.clientgenerator.core.flattenproperty.models.NestedFlattenModel + :rtype: ~specs.azure.clientgenerator.core.flattenproperty.models.NestedFlattenModel :raises ~azure.core.exceptions.HttpResponseError: """ @@ -228,7 +228,7 @@ def put_nested_flatten_model( Default value is "application/json". :paramtype content_type: str :return: NestedFlattenModel. The NestedFlattenModel is compatible with MutableMapping - :rtype: ~azure.clientgenerator.core.flattenproperty.models.NestedFlattenModel + :rtype: ~specs.azure.clientgenerator.core.flattenproperty.models.NestedFlattenModel :raises ~azure.core.exceptions.HttpResponseError: """ @@ -244,7 +244,7 @@ def put_nested_flatten_model( Default value is "application/json". :paramtype content_type: str :return: NestedFlattenModel. The NestedFlattenModel is compatible with MutableMapping - :rtype: ~azure.clientgenerator.core.flattenproperty.models.NestedFlattenModel + :rtype: ~specs.azure.clientgenerator.core.flattenproperty.models.NestedFlattenModel :raises ~azure.core.exceptions.HttpResponseError: """ @@ -255,10 +255,10 @@ def put_nested_flatten_model( """put_nested_flatten_model. :param input: Is one of the following types: NestedFlattenModel, JSON, IO[bytes] Required. - :type input: ~azure.clientgenerator.core.flattenproperty.models.NestedFlattenModel or JSON or - IO[bytes] + :type input: ~specs.azure.clientgenerator.core.flattenproperty.models.NestedFlattenModel or + JSON or IO[bytes] :return: NestedFlattenModel. The NestedFlattenModel is compatible with MutableMapping - :rtype: ~azure.clientgenerator.core.flattenproperty.models.NestedFlattenModel + :rtype: ~specs.azure.clientgenerator.core.flattenproperty.models.NestedFlattenModel :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping[int, Type[HttpResponseError]] = { diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/azure/clientgenerator/core/flattenproperty/_operations/_patch.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/specs/azure/clientgenerator/core/flattenproperty/_operations/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/azure/clientgenerator/core/flattenproperty/_operations/_patch.py rename to packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/specs/azure/clientgenerator/core/flattenproperty/_operations/_patch.py diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/azure/clientgenerator/core/flattenproperty/_patch.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/specs/azure/clientgenerator/core/flattenproperty/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/azure/clientgenerator/core/flattenproperty/_patch.py rename to packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/specs/azure/clientgenerator/core/flattenproperty/_patch.py diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/azure/clientgenerator/core/flattenproperty/_serialization.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/specs/azure/clientgenerator/core/flattenproperty/_serialization.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/azure/clientgenerator/core/flattenproperty/_serialization.py rename to packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/specs/azure/clientgenerator/core/flattenproperty/_serialization.py diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/azure/clientgenerator/core/flattenproperty/_vendor.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/specs/azure/clientgenerator/core/flattenproperty/_vendor.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/azure/clientgenerator/core/flattenproperty/_vendor.py rename to packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/specs/azure/clientgenerator/core/flattenproperty/_vendor.py diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/azure/clientgenerator/core/flattenproperty/_version.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/specs/azure/clientgenerator/core/flattenproperty/_version.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/azure/clientgenerator/core/flattenproperty/_version.py rename to packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/specs/azure/clientgenerator/core/flattenproperty/_version.py diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/azure/clientgenerator/core/flattenproperty/aio/__init__.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/specs/azure/clientgenerator/core/flattenproperty/aio/__init__.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/azure/clientgenerator/core/flattenproperty/aio/__init__.py rename to packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/specs/azure/clientgenerator/core/flattenproperty/aio/__init__.py diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/azure/clientgenerator/core/flattenproperty/aio/_client.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/specs/azure/clientgenerator/core/flattenproperty/aio/_client.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/azure/clientgenerator/core/flattenproperty/aio/_client.py rename to packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/specs/azure/clientgenerator/core/flattenproperty/aio/_client.py diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/azure/clientgenerator/core/flattenproperty/aio/_configuration.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/specs/azure/clientgenerator/core/flattenproperty/aio/_configuration.py similarity index 94% rename from packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/azure/clientgenerator/core/flattenproperty/aio/_configuration.py rename to packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/specs/azure/clientgenerator/core/flattenproperty/aio/_configuration.py index e734235eaa7..52ac5c7f305 100644 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/azure/clientgenerator/core/flattenproperty/aio/_configuration.py +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/specs/azure/clientgenerator/core/flattenproperty/aio/_configuration.py @@ -26,7 +26,7 @@ class FlattenPropertyClientConfiguration: # pylint: disable=too-many-instance-a def __init__(self, endpoint: str = "http://localhost:3000", **kwargs: Any) -> None: self.endpoint = endpoint - kwargs.setdefault("sdk_moniker", "clientgenerator-core-flattenproperty/{}".format(VERSION)) + kwargs.setdefault("sdk_moniker", "specs-azure-clientgenerator-core-flattenproperty/{}".format(VERSION)) self.polling_interval = kwargs.get("polling_interval", 30) self._configure(**kwargs) diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/azure/clientgenerator/core/flattenproperty/aio/_operations/__init__.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/specs/azure/clientgenerator/core/flattenproperty/aio/_operations/__init__.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/azure/clientgenerator/core/flattenproperty/aio/_operations/__init__.py rename to packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/specs/azure/clientgenerator/core/flattenproperty/aio/_operations/__init__.py diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/azure/clientgenerator/core/flattenproperty/aio/_operations/_operations.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/specs/azure/clientgenerator/core/flattenproperty/aio/_operations/_operations.py similarity index 90% rename from packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/azure/clientgenerator/core/flattenproperty/aio/_operations/_operations.py rename to packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/specs/azure/clientgenerator/core/flattenproperty/aio/_operations/_operations.py index 188a64d8fd0..b8077f3c23b 100644 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/azure/clientgenerator/core/flattenproperty/aio/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/specs/azure/clientgenerator/core/flattenproperty/aio/_operations/_operations.py @@ -52,12 +52,12 @@ async def put_flatten_model( """put_flatten_model. :param input: Required. - :type input: ~azure.clientgenerator.core.flattenproperty.models.FlattenModel + :type input: ~specs.azure.clientgenerator.core.flattenproperty.models.FlattenModel :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: FlattenModel. The FlattenModel is compatible with MutableMapping - :rtype: ~azure.clientgenerator.core.flattenproperty.models.FlattenModel + :rtype: ~specs.azure.clientgenerator.core.flattenproperty.models.FlattenModel :raises ~azure.core.exceptions.HttpResponseError: """ @@ -73,7 +73,7 @@ async def put_flatten_model( Default value is "application/json". :paramtype content_type: str :return: FlattenModel. The FlattenModel is compatible with MutableMapping - :rtype: ~azure.clientgenerator.core.flattenproperty.models.FlattenModel + :rtype: ~specs.azure.clientgenerator.core.flattenproperty.models.FlattenModel :raises ~azure.core.exceptions.HttpResponseError: """ @@ -89,7 +89,7 @@ async def put_flatten_model( Default value is "application/json". :paramtype content_type: str :return: FlattenModel. The FlattenModel is compatible with MutableMapping - :rtype: ~azure.clientgenerator.core.flattenproperty.models.FlattenModel + :rtype: ~specs.azure.clientgenerator.core.flattenproperty.models.FlattenModel :raises ~azure.core.exceptions.HttpResponseError: """ @@ -100,10 +100,10 @@ async def put_flatten_model( """put_flatten_model. :param input: Is one of the following types: FlattenModel, JSON, IO[bytes] Required. - :type input: ~azure.clientgenerator.core.flattenproperty.models.FlattenModel or JSON or + :type input: ~specs.azure.clientgenerator.core.flattenproperty.models.FlattenModel or JSON or IO[bytes] :return: FlattenModel. The FlattenModel is compatible with MutableMapping - :rtype: ~azure.clientgenerator.core.flattenproperty.models.FlattenModel + :rtype: ~specs.azure.clientgenerator.core.flattenproperty.models.FlattenModel :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping[int, Type[HttpResponseError]] = { @@ -171,12 +171,12 @@ async def put_nested_flatten_model( """put_nested_flatten_model. :param input: Required. - :type input: ~azure.clientgenerator.core.flattenproperty.models.NestedFlattenModel + :type input: ~specs.azure.clientgenerator.core.flattenproperty.models.NestedFlattenModel :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :return: NestedFlattenModel. The NestedFlattenModel is compatible with MutableMapping - :rtype: ~azure.clientgenerator.core.flattenproperty.models.NestedFlattenModel + :rtype: ~specs.azure.clientgenerator.core.flattenproperty.models.NestedFlattenModel :raises ~azure.core.exceptions.HttpResponseError: """ @@ -192,7 +192,7 @@ async def put_nested_flatten_model( Default value is "application/json". :paramtype content_type: str :return: NestedFlattenModel. The NestedFlattenModel is compatible with MutableMapping - :rtype: ~azure.clientgenerator.core.flattenproperty.models.NestedFlattenModel + :rtype: ~specs.azure.clientgenerator.core.flattenproperty.models.NestedFlattenModel :raises ~azure.core.exceptions.HttpResponseError: """ @@ -208,7 +208,7 @@ async def put_nested_flatten_model( Default value is "application/json". :paramtype content_type: str :return: NestedFlattenModel. The NestedFlattenModel is compatible with MutableMapping - :rtype: ~azure.clientgenerator.core.flattenproperty.models.NestedFlattenModel + :rtype: ~specs.azure.clientgenerator.core.flattenproperty.models.NestedFlattenModel :raises ~azure.core.exceptions.HttpResponseError: """ @@ -219,10 +219,10 @@ async def put_nested_flatten_model( """put_nested_flatten_model. :param input: Is one of the following types: NestedFlattenModel, JSON, IO[bytes] Required. - :type input: ~azure.clientgenerator.core.flattenproperty.models.NestedFlattenModel or JSON or - IO[bytes] + :type input: ~specs.azure.clientgenerator.core.flattenproperty.models.NestedFlattenModel or + JSON or IO[bytes] :return: NestedFlattenModel. The NestedFlattenModel is compatible with MutableMapping - :rtype: ~azure.clientgenerator.core.flattenproperty.models.NestedFlattenModel + :rtype: ~specs.azure.clientgenerator.core.flattenproperty.models.NestedFlattenModel :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping[int, Type[HttpResponseError]] = { diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/azure/clientgenerator/core/flattenproperty/aio/_operations/_patch.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/specs/azure/clientgenerator/core/flattenproperty/aio/_operations/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/azure/clientgenerator/core/flattenproperty/aio/_operations/_patch.py rename to packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/specs/azure/clientgenerator/core/flattenproperty/aio/_operations/_patch.py diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/azure/clientgenerator/core/flattenproperty/aio/_patch.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/specs/azure/clientgenerator/core/flattenproperty/aio/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/azure/clientgenerator/core/flattenproperty/aio/_patch.py rename to packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/specs/azure/clientgenerator/core/flattenproperty/aio/_patch.py diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/azure/clientgenerator/core/flattenproperty/aio/_vendor.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/specs/azure/clientgenerator/core/flattenproperty/aio/_vendor.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/azure/clientgenerator/core/flattenproperty/aio/_vendor.py rename to packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/specs/azure/clientgenerator/core/flattenproperty/aio/_vendor.py diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/azure/clientgenerator/core/flattenproperty/models/__init__.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/specs/azure/clientgenerator/core/flattenproperty/models/__init__.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/azure/clientgenerator/core/flattenproperty/models/__init__.py rename to packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/specs/azure/clientgenerator/core/flattenproperty/models/__init__.py diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/azure/clientgenerator/core/flattenproperty/models/_models.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/specs/azure/clientgenerator/core/flattenproperty/models/_models.py similarity index 95% rename from packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/azure/clientgenerator/core/flattenproperty/models/_models.py rename to packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/specs/azure/clientgenerator/core/flattenproperty/models/_models.py index a868b1aa981..b455b10da58 100644 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/azure/clientgenerator/core/flattenproperty/models/_models.py +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/specs/azure/clientgenerator/core/flattenproperty/models/_models.py @@ -24,7 +24,7 @@ class ChildFlattenModel(_model_base.Model): :ivar summary: Required. :vartype summary: str :ivar properties: Required. - :vartype properties: ~azure.clientgenerator.core.flattenproperty.models.ChildModel + :vartype properties: ~specs.azure.clientgenerator.core.flattenproperty.models.ChildModel """ summary: str = rest_field() @@ -112,7 +112,7 @@ class FlattenModel(_model_base.Model): :ivar name: Required. :vartype name: str :ivar properties: Required. - :vartype properties: ~azure.clientgenerator.core.flattenproperty.models.ChildModel + :vartype properties: ~specs.azure.clientgenerator.core.flattenproperty.models.ChildModel """ name: str = rest_field() @@ -166,7 +166,7 @@ class NestedFlattenModel(_model_base.Model): :ivar name: Required. :vartype name: str :ivar properties: Required. - :vartype properties: ~azure.clientgenerator.core.flattenproperty.models.ChildFlattenModel + :vartype properties: ~specs.azure.clientgenerator.core.flattenproperty.models.ChildFlattenModel """ name: str = rest_field() diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/azure/clientgenerator/core/flattenproperty/models/_patch.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/specs/azure/clientgenerator/core/flattenproperty/models/_patch.py similarity index 100% rename from packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/azure/clientgenerator/core/flattenproperty/models/_patch.py rename to packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/specs/azure/clientgenerator/core/flattenproperty/models/_patch.py diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/azure/clientgenerator/core/flattenproperty/py.typed b/packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/specs/azure/clientgenerator/core/flattenproperty/py.typed similarity index 100% rename from packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/azure/clientgenerator/core/flattenproperty/py.typed rename to packages/typespec-python/test/azure/generated/azure-client-generator-core-flatten-property/specs/azure/clientgenerator/core/flattenproperty/py.typed diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/generated_tests/test_usage_model_in_operation_operations.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/generated_tests/test_usage_model_in_operation_operations.py index 34d0e43ff43..1594a7225fd 100644 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/generated_tests/test_usage_model_in_operation_operations.py +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/generated_tests/test_usage_model_in_operation_operations.py @@ -14,7 +14,7 @@ class TestUsageModelInOperationOperations(UsageClientTestBase): @UsagePreparer() @recorded_by_proxy - def test_input_to_input_output(self, usage_endpoint): + def test_model_in_operation_input_to_input_output(self, usage_endpoint): client = self.create_client(endpoint=usage_endpoint) response = client.model_in_operation.input_to_input_output( body={"name": "str"}, @@ -25,7 +25,7 @@ def test_input_to_input_output(self, usage_endpoint): @UsagePreparer() @recorded_by_proxy - def test_output_to_input_output(self, usage_endpoint): + def test_model_in_operation_output_to_input_output(self, usage_endpoint): client = self.create_client(endpoint=usage_endpoint) response = client.model_in_operation.output_to_input_output() @@ -34,7 +34,7 @@ def test_output_to_input_output(self, usage_endpoint): @UsagePreparer() @recorded_by_proxy - def test_model_in_read_only_property(self, usage_endpoint): + def test_model_in_operation_model_in_read_only_property(self, usage_endpoint): client = self.create_client(endpoint=usage_endpoint) response = client.model_in_operation.model_in_read_only_property( body={"result": {"name": "str"}}, diff --git a/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/generated_tests/test_usage_model_in_operation_operations_async.py b/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/generated_tests/test_usage_model_in_operation_operations_async.py index c2e37552cd5..c0b04a06e4d 100644 --- a/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/generated_tests/test_usage_model_in_operation_operations_async.py +++ b/packages/typespec-python/test/azure/generated/azure-client-generator-core-usage/generated_tests/test_usage_model_in_operation_operations_async.py @@ -15,7 +15,7 @@ class TestUsageModelInOperationOperationsAsync(UsageClientTestBaseAsync): @UsagePreparer() @recorded_by_proxy_async - async def test_input_to_input_output(self, usage_endpoint): + async def test_model_in_operation_input_to_input_output(self, usage_endpoint): client = self.create_async_client(endpoint=usage_endpoint) response = await client.model_in_operation.input_to_input_output( body={"name": "str"}, @@ -26,7 +26,7 @@ async def test_input_to_input_output(self, usage_endpoint): @UsagePreparer() @recorded_by_proxy_async - async def test_output_to_input_output(self, usage_endpoint): + async def test_model_in_operation_output_to_input_output(self, usage_endpoint): client = self.create_async_client(endpoint=usage_endpoint) response = await client.model_in_operation.output_to_input_output() @@ -35,7 +35,7 @@ async def test_output_to_input_output(self, usage_endpoint): @UsagePreparer() @recorded_by_proxy_async - async def test_model_in_read_only_property(self, usage_endpoint): + async def test_model_in_operation_model_in_read_only_property(self, usage_endpoint): client = self.create_async_client(endpoint=usage_endpoint) response = await client.model_in_operation.model_in_read_only_property( body={"result": {"name": "str"}}, diff --git a/packages/typespec-python/test/azure/generated/azure-core-basic/apiview_mapping_python.json b/packages/typespec-python/test/azure/generated/azure-core-basic/apiview_mapping_python.json index 80e1e3fb09d..0e1873347ea 100644 --- a/packages/typespec-python/test/azure/generated/azure-core-basic/apiview_mapping_python.json +++ b/packages/typespec-python/test/azure/generated/azure-core-basic/apiview_mapping_python.json @@ -2,12 +2,14 @@ "CrossLanguagePackageId": "_Specs_.Azure.Core.Basic", "CrossLanguageDefinitionId": { "specs.azure.core.basic.models.User": "_Specs_.Azure.Core.Basic.User", + "specs.azure.core.basic.models.UserList": "_Specs_.Azure.Core.Basic.UserList", "specs.azure.core.basic.models.UserOrder": "_Specs_.Azure.Core.Basic.UserOrder", "specs.azure.core.basic.BasicClient.create_or_update": "_Specs_.Azure.Core.Basic.createOrUpdate", "specs.azure.core.basic.BasicClient.create_or_replace": "_Specs_.Azure.Core.Basic.createOrReplace", "specs.azure.core.basic.BasicClient.get": "_Specs_.Azure.Core.Basic.get", "specs.azure.core.basic.BasicClient.list": "_Specs_.Azure.Core.Basic.list", "specs.azure.core.basic.BasicClient.delete": "_Specs_.Azure.Core.Basic.delete", - "specs.azure.core.basic.BasicClient.export": "_Specs_.Azure.Core.Basic.export" + "specs.azure.core.basic.BasicClient.export": "_Specs_.Azure.Core.Basic.export", + "specs.azure.core.basic.BasicClient.export_all_users": "_Specs_.Azure.Core.Basic.exportAllUsers" } } \ No newline at end of file diff --git a/packages/typespec-python/test/azure/generated/azure-core-basic/generated_tests/test_basic.py b/packages/typespec-python/test/azure/generated/azure-core-basic/generated_tests/test_basic.py index 3bce0e4f1d9..4e1621dc840 100644 --- a/packages/typespec-python/test/azure/generated/azure-core-basic/generated_tests/test_basic.py +++ b/packages/typespec-python/test/azure/generated/azure-core-basic/generated_tests/test_basic.py @@ -78,3 +78,14 @@ def test_export(self, basic_endpoint): # please add some check logic here by yourself # ... + + @BasicPreparer() + @recorded_by_proxy + def test_export_all_users(self, basic_endpoint): + client = self.create_client(endpoint=basic_endpoint) + response = client.export_all_users( + format="str", + ) + + # please add some check logic here by yourself + # ... diff --git a/packages/typespec-python/test/azure/generated/azure-core-basic/generated_tests/test_basic_async.py b/packages/typespec-python/test/azure/generated/azure-core-basic/generated_tests/test_basic_async.py index 31cb1487f54..c3c7f05a6cf 100644 --- a/packages/typespec-python/test/azure/generated/azure-core-basic/generated_tests/test_basic_async.py +++ b/packages/typespec-python/test/azure/generated/azure-core-basic/generated_tests/test_basic_async.py @@ -79,3 +79,14 @@ async def test_export(self, basic_endpoint): # please add some check logic here by yourself # ... + + @BasicPreparer() + @recorded_by_proxy_async + async def test_export_all_users(self, basic_endpoint): + client = self.create_async_client(endpoint=basic_endpoint) + response = await client.export_all_users( + format="str", + ) + + # please add some check logic here by yourself + # ... diff --git a/packages/typespec-python/test/azure/generated/azure-core-basic/specs/azure/core/basic/_operations/_operations.py b/packages/typespec-python/test/azure/generated/azure-core-basic/specs/azure/core/basic/_operations/_operations.py index 3fcf6441989..d1753772c2d 100644 --- a/packages/typespec-python/test/azure/generated/azure-core-basic/specs/azure/core/basic/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/azure-core-basic/specs/azure/core/basic/_operations/_operations.py @@ -215,6 +215,26 @@ def build_basic_export_request(id: int, *, format: str, **kwargs: Any) -> HttpRe return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) +def build_basic_export_all_users_request(*, format: str, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-12-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/azure/core/basic/users:exportallusers" + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + _params["format"] = _SERIALIZER.query("format", format, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + class BasicClientOperationsMixin(BasicClientMixinABC): @overload @@ -779,3 +799,65 @@ def export(self, id: int, *, format: str, **kwargs: Any) -> _models.User: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore + + @distributed_trace + def export_all_users(self, *, format: str, **kwargs: Any) -> _models.UserList: + """Exports all users. + + Exports all users. + + :keyword format: The format of the data. Required. + :paramtype format: str + :return: UserList. The UserList is compatible with MutableMapping + :rtype: ~specs.azure.core.basic.models.UserList + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.UserList] = kwargs.pop("cls", None) + + _request = build_basic_export_all_users_request( + format=format, + api_version=self._config.api_version, + 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(_models.UserList, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore diff --git a/packages/typespec-python/test/azure/generated/azure-core-basic/specs/azure/core/basic/aio/_operations/_operations.py b/packages/typespec-python/test/azure/generated/azure-core-basic/specs/azure/core/basic/aio/_operations/_operations.py index d9376570036..4fdcbe9509c 100644 --- a/packages/typespec-python/test/azure/generated/azure-core-basic/specs/azure/core/basic/aio/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/azure-core-basic/specs/azure/core/basic/aio/_operations/_operations.py @@ -35,6 +35,7 @@ build_basic_create_or_replace_request, build_basic_create_or_update_request, build_basic_delete_request, + build_basic_export_all_users_request, build_basic_export_request, build_basic_get_request, build_basic_list_request, @@ -618,3 +619,65 @@ async def export(self, id: int, *, format: str, **kwargs: Any) -> _models.User: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore + + @distributed_trace_async + async def export_all_users(self, *, format: str, **kwargs: Any) -> _models.UserList: + """Exports all users. + + Exports all users. + + :keyword format: The format of the data. Required. + :paramtype format: str + :return: UserList. The UserList is compatible with MutableMapping + :rtype: ~specs.azure.core.basic.models.UserList + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.UserList] = kwargs.pop("cls", None) + + _request = build_basic_export_all_users_request( + format=format, + api_version=self._config.api_version, + 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( # type: ignore # 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(_models.UserList, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore diff --git a/packages/typespec-python/test/azure/generated/azure-core-basic/specs/azure/core/basic/models/__init__.py b/packages/typespec-python/test/azure/generated/azure-core-basic/specs/azure/core/basic/models/__init__.py index 7d29e2b1301..21893141023 100644 --- a/packages/typespec-python/test/azure/generated/azure-core-basic/specs/azure/core/basic/models/__init__.py +++ b/packages/typespec-python/test/azure/generated/azure-core-basic/specs/azure/core/basic/models/__init__.py @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from ._models import User +from ._models import UserList from ._models import UserOrder from ._patch import __all__ as _patch_all from ._patch import * # pylint: disable=unused-wildcard-import @@ -14,6 +15,7 @@ __all__ = [ "User", + "UserList", "UserOrder", ] __all__.extend([p for p in _patch_all if p not in __all__]) diff --git a/packages/typespec-python/test/azure/generated/azure-core-basic/specs/azure/core/basic/models/_models.py b/packages/typespec-python/test/azure/generated/azure-core-basic/specs/azure/core/basic/models/_models.py index 722b06d7e14..8829d19bd1b 100644 --- a/packages/typespec-python/test/azure/generated/azure-core-basic/specs/azure/core/basic/models/_models.py +++ b/packages/typespec-python/test/azure/generated/azure-core-basic/specs/azure/core/basic/models/_models.py @@ -61,6 +61,35 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useles super().__init__(*args, **kwargs) +class UserList(_model_base.Model): + """UserList. + + + :ivar users: Required. + :vartype users: list[~specs.azure.core.basic.models.User] + """ + + users: List["_models.User"] = rest_field() + """Required.""" + + @overload + def __init__( + self, + *, + users: List["_models.User"], + ): ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + + class UserOrder(_model_base.Model): """UserOrder for testing list with expand. diff --git a/packages/typespec-python/test/azure/generated/azure-core-model/generated_tests/test_model_azure_core_embedding_vector_operations.py b/packages/typespec-python/test/azure/generated/azure-core-model/generated_tests/test_model_azure_core_embedding_vector_operations.py index 169a60e79d3..824eea481e1 100644 --- a/packages/typespec-python/test/azure/generated/azure-core-model/generated_tests/test_model_azure_core_embedding_vector_operations.py +++ b/packages/typespec-python/test/azure/generated/azure-core-model/generated_tests/test_model_azure_core_embedding_vector_operations.py @@ -14,7 +14,7 @@ class TestModelAzureCoreEmbeddingVectorOperations(ModelClientTestBase): @ModelPreparer() @recorded_by_proxy - def test_get(self, model_endpoint): + def test_azure_core_embedding_vector_get(self, model_endpoint): client = self.create_client(endpoint=model_endpoint) response = client.azure_core_embedding_vector.get() @@ -23,7 +23,7 @@ def test_get(self, model_endpoint): @ModelPreparer() @recorded_by_proxy - def test_put(self, model_endpoint): + def test_azure_core_embedding_vector_put(self, model_endpoint): client = self.create_client(endpoint=model_endpoint) response = client.azure_core_embedding_vector.put( body=[0], @@ -34,7 +34,7 @@ def test_put(self, model_endpoint): @ModelPreparer() @recorded_by_proxy - def test_post(self, model_endpoint): + def test_azure_core_embedding_vector_post(self, model_endpoint): client = self.create_client(endpoint=model_endpoint) response = client.azure_core_embedding_vector.post( body={"embedding": [0]}, diff --git a/packages/typespec-python/test/azure/generated/azure-core-model/generated_tests/test_model_azure_core_embedding_vector_operations_async.py b/packages/typespec-python/test/azure/generated/azure-core-model/generated_tests/test_model_azure_core_embedding_vector_operations_async.py index 22133001bcb..b7f1463844b 100644 --- a/packages/typespec-python/test/azure/generated/azure-core-model/generated_tests/test_model_azure_core_embedding_vector_operations_async.py +++ b/packages/typespec-python/test/azure/generated/azure-core-model/generated_tests/test_model_azure_core_embedding_vector_operations_async.py @@ -15,7 +15,7 @@ class TestModelAzureCoreEmbeddingVectorOperationsAsync(ModelClientTestBaseAsync): @ModelPreparer() @recorded_by_proxy_async - async def test_get(self, model_endpoint): + async def test_azure_core_embedding_vector_get(self, model_endpoint): client = self.create_async_client(endpoint=model_endpoint) response = await client.azure_core_embedding_vector.get() @@ -24,7 +24,7 @@ async def test_get(self, model_endpoint): @ModelPreparer() @recorded_by_proxy_async - async def test_put(self, model_endpoint): + async def test_azure_core_embedding_vector_put(self, model_endpoint): client = self.create_async_client(endpoint=model_endpoint) response = await client.azure_core_embedding_vector.put( body=[0], @@ -35,7 +35,7 @@ async def test_put(self, model_endpoint): @ModelPreparer() @recorded_by_proxy_async - async def test_post(self, model_endpoint): + async def test_azure_core_embedding_vector_post(self, model_endpoint): client = self.create_async_client(endpoint=model_endpoint) response = await client.azure_core_embedding_vector.post( body={"embedding": [0]}, diff --git a/packages/typespec-python/test/azure/generated/azure-core-page/generated_tests/test_page_two_models_as_page_item_operations.py b/packages/typespec-python/test/azure/generated/azure-core-page/generated_tests/test_page_two_models_as_page_item_operations.py index 701380c3b9a..e3b9755a70d 100644 --- a/packages/typespec-python/test/azure/generated/azure-core-page/generated_tests/test_page_two_models_as_page_item_operations.py +++ b/packages/typespec-python/test/azure/generated/azure-core-page/generated_tests/test_page_two_models_as_page_item_operations.py @@ -14,7 +14,7 @@ class TestPageTwoModelsAsPageItemOperations(PageClientTestBase): @PagePreparer() @recorded_by_proxy - def test_list_first_item(self, page_endpoint): + def test_two_models_as_page_item_list_first_item(self, page_endpoint): client = self.create_client(endpoint=page_endpoint) response = client.two_models_as_page_item.list_first_item() result = [r for r in response] @@ -23,7 +23,7 @@ def test_list_first_item(self, page_endpoint): @PagePreparer() @recorded_by_proxy - def test_list_second_item(self, page_endpoint): + def test_two_models_as_page_item_list_second_item(self, page_endpoint): client = self.create_client(endpoint=page_endpoint) response = client.two_models_as_page_item.list_second_item() result = [r for r in response] diff --git a/packages/typespec-python/test/azure/generated/azure-core-page/generated_tests/test_page_two_models_as_page_item_operations_async.py b/packages/typespec-python/test/azure/generated/azure-core-page/generated_tests/test_page_two_models_as_page_item_operations_async.py index 48e1aa5e1ea..6ce3f441718 100644 --- a/packages/typespec-python/test/azure/generated/azure-core-page/generated_tests/test_page_two_models_as_page_item_operations_async.py +++ b/packages/typespec-python/test/azure/generated/azure-core-page/generated_tests/test_page_two_models_as_page_item_operations_async.py @@ -15,7 +15,7 @@ class TestPageTwoModelsAsPageItemOperationsAsync(PageClientTestBaseAsync): @PagePreparer() @recorded_by_proxy_async - async def test_list_first_item(self, page_endpoint): + async def test_two_models_as_page_item_list_first_item(self, page_endpoint): client = self.create_async_client(endpoint=page_endpoint) response = client.two_models_as_page_item.list_first_item() result = [r async for r in response] @@ -24,7 +24,7 @@ async def test_list_first_item(self, page_endpoint): @PagePreparer() @recorded_by_proxy_async - async def test_list_second_item(self, page_endpoint): + async def test_two_models_as_page_item_list_second_item(self, page_endpoint): client = self.create_async_client(endpoint=page_endpoint) response = client.two_models_as_page_item.list_second_item() result = [r async for r in response] diff --git a/packages/typespec-python/test/azure/generated/azure-core-scalar/generated_tests/test_scalar_azure_location_scalar_operations.py b/packages/typespec-python/test/azure/generated/azure-core-scalar/generated_tests/test_scalar_azure_location_scalar_operations.py index 35ca3f2f62a..234ea6351a1 100644 --- a/packages/typespec-python/test/azure/generated/azure-core-scalar/generated_tests/test_scalar_azure_location_scalar_operations.py +++ b/packages/typespec-python/test/azure/generated/azure-core-scalar/generated_tests/test_scalar_azure_location_scalar_operations.py @@ -14,7 +14,7 @@ class TestScalarAzureLocationScalarOperations(ScalarClientTestBase): @ScalarPreparer() @recorded_by_proxy - def test_get(self, scalar_endpoint): + def test_azure_location_scalar_get(self, scalar_endpoint): client = self.create_client(endpoint=scalar_endpoint) response = client.azure_location_scalar.get() @@ -23,7 +23,7 @@ def test_get(self, scalar_endpoint): @ScalarPreparer() @recorded_by_proxy - def test_put(self, scalar_endpoint): + def test_azure_location_scalar_put(self, scalar_endpoint): client = self.create_client(endpoint=scalar_endpoint) response = client.azure_location_scalar.put( body="str", @@ -35,7 +35,7 @@ def test_put(self, scalar_endpoint): @ScalarPreparer() @recorded_by_proxy - def test_post(self, scalar_endpoint): + def test_azure_location_scalar_post(self, scalar_endpoint): client = self.create_client(endpoint=scalar_endpoint) response = client.azure_location_scalar.post( body={"location": "str"}, @@ -46,7 +46,7 @@ def test_post(self, scalar_endpoint): @ScalarPreparer() @recorded_by_proxy - def test_header(self, scalar_endpoint): + def test_azure_location_scalar_header(self, scalar_endpoint): client = self.create_client(endpoint=scalar_endpoint) response = client.azure_location_scalar.header( region="str", @@ -57,7 +57,7 @@ def test_header(self, scalar_endpoint): @ScalarPreparer() @recorded_by_proxy - def test_query(self, scalar_endpoint): + def test_azure_location_scalar_query(self, scalar_endpoint): client = self.create_client(endpoint=scalar_endpoint) response = client.azure_location_scalar.query( region="str", diff --git a/packages/typespec-python/test/azure/generated/azure-core-scalar/generated_tests/test_scalar_azure_location_scalar_operations_async.py b/packages/typespec-python/test/azure/generated/azure-core-scalar/generated_tests/test_scalar_azure_location_scalar_operations_async.py index 9ba22403041..38cff3d36b5 100644 --- a/packages/typespec-python/test/azure/generated/azure-core-scalar/generated_tests/test_scalar_azure_location_scalar_operations_async.py +++ b/packages/typespec-python/test/azure/generated/azure-core-scalar/generated_tests/test_scalar_azure_location_scalar_operations_async.py @@ -15,7 +15,7 @@ class TestScalarAzureLocationScalarOperationsAsync(ScalarClientTestBaseAsync): @ScalarPreparer() @recorded_by_proxy_async - async def test_get(self, scalar_endpoint): + async def test_azure_location_scalar_get(self, scalar_endpoint): client = self.create_async_client(endpoint=scalar_endpoint) response = await client.azure_location_scalar.get() @@ -24,7 +24,7 @@ async def test_get(self, scalar_endpoint): @ScalarPreparer() @recorded_by_proxy_async - async def test_put(self, scalar_endpoint): + async def test_azure_location_scalar_put(self, scalar_endpoint): client = self.create_async_client(endpoint=scalar_endpoint) response = await client.azure_location_scalar.put( body="str", @@ -36,7 +36,7 @@ async def test_put(self, scalar_endpoint): @ScalarPreparer() @recorded_by_proxy_async - async def test_post(self, scalar_endpoint): + async def test_azure_location_scalar_post(self, scalar_endpoint): client = self.create_async_client(endpoint=scalar_endpoint) response = await client.azure_location_scalar.post( body={"location": "str"}, @@ -47,7 +47,7 @@ async def test_post(self, scalar_endpoint): @ScalarPreparer() @recorded_by_proxy_async - async def test_header(self, scalar_endpoint): + async def test_azure_location_scalar_header(self, scalar_endpoint): client = self.create_async_client(endpoint=scalar_endpoint) response = await client.azure_location_scalar.header( region="str", @@ -58,7 +58,7 @@ async def test_header(self, scalar_endpoint): @ScalarPreparer() @recorded_by_proxy_async - async def test_query(self, scalar_endpoint): + async def test_azure_location_scalar_query(self, scalar_endpoint): client = self.create_async_client(endpoint=scalar_endpoint) response = await client.azure_location_scalar.query( region="str", diff --git a/packages/typespec-python/test/azure/generated/azure-resource-manager-models-common-types-managed-identity/generated_tests/test_managed_identity_managed_identity_tracked_resources_operations.py b/packages/typespec-python/test/azure/generated/azure-resource-manager-models-common-types-managed-identity/generated_tests/test_managed_identity_managed_identity_tracked_resources_operations.py index 886ef3f8f39..549eeedd3ff 100644 --- a/packages/typespec-python/test/azure/generated/azure-resource-manager-models-common-types-managed-identity/generated_tests/test_managed_identity_managed_identity_tracked_resources_operations.py +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-models-common-types-managed-identity/generated_tests/test_managed_identity_managed_identity_tracked_resources_operations.py @@ -20,7 +20,7 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_managed_identity_tracked_resources_get(self, resource_group): response = self.client.managed_identity_tracked_resources.get( resource_group_name=resource_group.name, managed_identity_tracked_resource_name="str", @@ -31,7 +31,7 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_create_with_system_assigned(self, resource_group): + def test_managed_identity_tracked_resources_create_with_system_assigned(self, resource_group): response = self.client.managed_identity_tracked_resources.create_with_system_assigned( resource_group_name=resource_group.name, managed_identity_tracked_resource_name="str", @@ -64,7 +64,7 @@ def test_create_with_system_assigned(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_update_with_user_assigned_and_system_assigned(self, resource_group): + def test_managed_identity_tracked_resources_update_with_user_assigned_and_system_assigned(self, resource_group): response = self.client.managed_identity_tracked_resources.update_with_user_assigned_and_system_assigned( resource_group_name=resource_group.name, managed_identity_tracked_resource_name="str", diff --git a/packages/typespec-python/test/azure/generated/azure-resource-manager-models-common-types-managed-identity/generated_tests/test_managed_identity_managed_identity_tracked_resources_operations_async.py b/packages/typespec-python/test/azure/generated/azure-resource-manager-models-common-types-managed-identity/generated_tests/test_managed_identity_managed_identity_tracked_resources_operations_async.py index 1ce96a1cc2e..b922059064b 100644 --- a/packages/typespec-python/test/azure/generated/azure-resource-manager-models-common-types-managed-identity/generated_tests/test_managed_identity_managed_identity_tracked_resources_operations_async.py +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-models-common-types-managed-identity/generated_tests/test_managed_identity_managed_identity_tracked_resources_operations_async.py @@ -21,7 +21,7 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_managed_identity_tracked_resources_get(self, resource_group): response = await self.client.managed_identity_tracked_resources.get( resource_group_name=resource_group.name, managed_identity_tracked_resource_name="str", @@ -32,7 +32,7 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_create_with_system_assigned(self, resource_group): + async def test_managed_identity_tracked_resources_create_with_system_assigned(self, resource_group): response = await self.client.managed_identity_tracked_resources.create_with_system_assigned( resource_group_name=resource_group.name, managed_identity_tracked_resource_name="str", @@ -65,7 +65,9 @@ async def test_create_with_system_assigned(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_update_with_user_assigned_and_system_assigned(self, resource_group): + async def test_managed_identity_tracked_resources_update_with_user_assigned_and_system_assigned( + self, resource_group + ): response = await self.client.managed_identity_tracked_resources.update_with_user_assigned_and_system_assigned( resource_group_name=resource_group.name, managed_identity_tracked_resource_name="str", diff --git a/packages/typespec-python/test/azure/generated/azure-resource-manager-models-resources/apiview_mapping_python.json b/packages/typespec-python/test/azure/generated/azure-resource-manager-models-resources/apiview_mapping_python.json index de1f5258c57..b770c6f77d0 100644 --- a/packages/typespec-python/test/azure/generated/azure-resource-manager-models-resources/apiview_mapping_python.json +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-models-resources/apiview_mapping_python.json @@ -9,8 +9,10 @@ "azure.resourcemanager.models.resources.models.NestedProxyResource": "Azure.ResourceManager.Models.Resources.NestedProxyResource", "azure.resourcemanager.models.resources.models.NestedProxyResourceProperties": "Azure.ResourceManager.Models.Resources.NestedProxyResourceProperties", "azure.resourcemanager.models.resources.models.NotificationDetails": "Azure.ResourceManager.Models.Resources.NotificationDetails", - "azure.resourcemanager.models.resources.models.SystemData": "Azure.ResourceManager.CommonTypes.SystemData", "azure.resourcemanager.models.resources.models.TrackedResource": "Azure.ResourceManager.CommonTypes.TrackedResource", + "azure.resourcemanager.models.resources.models.SingletonTrackedResource": "Azure.ResourceManager.Models.Resources.SingletonTrackedResource", + "azure.resourcemanager.models.resources.models.SingletonTrackedResourceProperties": "Azure.ResourceManager.Models.Resources.SingletonTrackedResourceProperties", + "azure.resourcemanager.models.resources.models.SystemData": "Azure.ResourceManager.CommonTypes.SystemData", "azure.resourcemanager.models.resources.models.TopLevelTrackedResource": "Azure.ResourceManager.Models.Resources.TopLevelTrackedResource", "azure.resourcemanager.models.resources.models.TopLevelTrackedResourceProperties": "Azure.ResourceManager.Models.Resources.TopLevelTrackedResourceProperties", "azure.resourcemanager.models.resources.models.CreatedByType": "Azure.ResourceManager.CommonTypes.createdByType", @@ -26,6 +28,10 @@ "azure.resourcemanager.models.resources.ResourcesClient.nested_proxy_resources.begin_create_or_replace": "Azure.ResourceManager.Models.Resources.NestedProxyResources.createOrReplace", "azure.resourcemanager.models.resources.ResourcesClient.nested_proxy_resources.begin_update": "Azure.ResourceManager.Models.Resources.NestedProxyResources.update", "azure.resourcemanager.models.resources.ResourcesClient.nested_proxy_resources.begin_delete": "Azure.ResourceManager.Models.Resources.NestedProxyResources.delete", - "azure.resourcemanager.models.resources.ResourcesClient.nested_proxy_resources.list_by_top_level_tracked_resource": "Azure.ResourceManager.Models.Resources.NestedProxyResources.listByTopLevelTrackedResource" + "azure.resourcemanager.models.resources.ResourcesClient.nested_proxy_resources.list_by_top_level_tracked_resource": "Azure.ResourceManager.Models.Resources.NestedProxyResources.listByTopLevelTrackedResource", + "azure.resourcemanager.models.resources.ResourcesClient.singleton_tracked_resources.get_by_resource_group": "Azure.ResourceManager.Models.Resources.SingletonTrackedResources.getByResourceGroup", + "azure.resourcemanager.models.resources.ResourcesClient.singleton_tracked_resources.begin_create_or_update": "Azure.ResourceManager.Models.Resources.SingletonTrackedResources.createOrUpdate", + "azure.resourcemanager.models.resources.ResourcesClient.singleton_tracked_resources.update": "Azure.ResourceManager.Models.Resources.SingletonTrackedResources.update", + "azure.resourcemanager.models.resources.ResourcesClient.singleton_tracked_resources.list_by_resource_group": "Azure.ResourceManager.Models.Resources.SingletonTrackedResources.listByResourceGroup" } } \ No newline at end of file diff --git a/packages/typespec-python/test/azure/generated/azure-resource-manager-models-resources/azure/resourcemanager/models/resources/_client.py b/packages/typespec-python/test/azure/generated/azure-resource-manager-models-resources/azure/resourcemanager/models/resources/_client.py index 0062d71a011..e16797ceb2e 100644 --- a/packages/typespec-python/test/azure/generated/azure-resource-manager-models-resources/azure/resourcemanager/models/resources/_client.py +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-models-resources/azure/resourcemanager/models/resources/_client.py @@ -17,7 +17,11 @@ from ._configuration import ResourcesClientConfiguration from ._serialization import Deserializer, Serializer -from .operations import NestedProxyResourcesOperations, TopLevelTrackedResourcesOperations +from .operations import ( + NestedProxyResourcesOperations, + SingletonTrackedResourcesOperations, + TopLevelTrackedResourcesOperations, +) if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -33,6 +37,9 @@ class ResourcesClient: # pylint: disable=client-accepts-api-version-keyword :ivar nested_proxy_resources: NestedProxyResourcesOperations operations :vartype nested_proxy_resources: azure.resourcemanager.models.resources.operations.NestedProxyResourcesOperations + :ivar singleton_tracked_resources: SingletonTrackedResourcesOperations operations + :vartype singleton_tracked_resources: + azure.resourcemanager.models.resources.operations.SingletonTrackedResourcesOperations :param credential: Credential used to authenticate requests to the service. Required. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. @@ -87,6 +94,9 @@ def __init__( self.nested_proxy_resources = NestedProxyResourcesOperations( self._client, self._config, self._serialize, self._deserialize ) + self.singleton_tracked_resources = SingletonTrackedResourcesOperations( + self._client, self._config, self._serialize, self._deserialize + ) def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: """Runs the network request through the client's chained policies. diff --git a/packages/typespec-python/test/azure/generated/azure-resource-manager-models-resources/azure/resourcemanager/models/resources/aio/_client.py b/packages/typespec-python/test/azure/generated/azure-resource-manager-models-resources/azure/resourcemanager/models/resources/aio/_client.py index cffb32957b3..dac1649a320 100644 --- a/packages/typespec-python/test/azure/generated/azure-resource-manager-models-resources/azure/resourcemanager/models/resources/aio/_client.py +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-models-resources/azure/resourcemanager/models/resources/aio/_client.py @@ -17,7 +17,11 @@ from .._serialization import Deserializer, Serializer from ._configuration import ResourcesClientConfiguration -from .operations import NestedProxyResourcesOperations, TopLevelTrackedResourcesOperations +from .operations import ( + NestedProxyResourcesOperations, + SingletonTrackedResourcesOperations, + TopLevelTrackedResourcesOperations, +) if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -33,6 +37,9 @@ class ResourcesClient: # pylint: disable=client-accepts-api-version-keyword :ivar nested_proxy_resources: NestedProxyResourcesOperations operations :vartype nested_proxy_resources: azure.resourcemanager.models.resources.aio.operations.NestedProxyResourcesOperations + :ivar singleton_tracked_resources: SingletonTrackedResourcesOperations operations + :vartype singleton_tracked_resources: + azure.resourcemanager.models.resources.aio.operations.SingletonTrackedResourcesOperations :param credential: Credential used to authenticate requests to the service. Required. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. @@ -87,6 +94,9 @@ def __init__( self.nested_proxy_resources = NestedProxyResourcesOperations( self._client, self._config, self._serialize, self._deserialize ) + self.singleton_tracked_resources = SingletonTrackedResourcesOperations( + self._client, self._config, self._serialize, self._deserialize + ) def send_request( self, request: HttpRequest, *, stream: bool = False, **kwargs: Any diff --git a/packages/typespec-python/test/azure/generated/azure-resource-manager-models-resources/azure/resourcemanager/models/resources/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/azure-resource-manager-models-resources/azure/resourcemanager/models/resources/aio/operations/__init__.py index 23b474954f8..56026fc797b 100644 --- a/packages/typespec-python/test/azure/generated/azure-resource-manager-models-resources/azure/resourcemanager/models/resources/aio/operations/__init__.py +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-models-resources/azure/resourcemanager/models/resources/aio/operations/__init__.py @@ -8,6 +8,7 @@ from ._operations import TopLevelTrackedResourcesOperations from ._operations import NestedProxyResourcesOperations +from ._operations import SingletonTrackedResourcesOperations from ._patch import __all__ as _patch_all from ._patch import * # pylint: disable=unused-wildcard-import @@ -16,6 +17,7 @@ __all__ = [ "TopLevelTrackedResourcesOperations", "NestedProxyResourcesOperations", + "SingletonTrackedResourcesOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/azure-resource-manager-models-resources/azure/resourcemanager/models/resources/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/azure-resource-manager-models-resources/azure/resourcemanager/models/resources/aio/operations/_operations.py index fcad1708903..b548c764529 100644 --- a/packages/typespec-python/test/azure/generated/azure-resource-manager-models-resources/azure/resourcemanager/models/resources/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-models-resources/azure/resourcemanager/models/resources/aio/operations/_operations.py @@ -54,6 +54,10 @@ build_nested_proxy_resources_get_request, build_nested_proxy_resources_list_by_top_level_tracked_resource_request, build_nested_proxy_resources_update_request, + build_singleton_tracked_resources_create_or_update_request, + build_singleton_tracked_resources_get_by_resource_group_request, + build_singleton_tracked_resources_list_by_resource_group_request, + build_singleton_tracked_resources_update_request, build_top_level_tracked_resources_action_sync_request, build_top_level_tracked_resources_create_or_replace_request, build_top_level_tracked_resources_delete_request, @@ -1892,3 +1896,536 @@ async def get_next(next_link=None): return pipeline_response return AsyncItemPaged(get_next, extract_data) + + +class SingletonTrackedResourcesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.resourcemanager.models.resources.aio.ResourcesClient`'s + :attr:`singleton_tracked_resources` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> _models.SingletonTrackedResource: + """Get a SingletonTrackedResource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: SingletonTrackedResource. The SingletonTrackedResource is compatible with + MutableMapping + :rtype: ~azure.resourcemanager.models.resources.models.SingletonTrackedResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.SingletonTrackedResource] = kwargs.pop("cls", None) + + _request = build_singleton_tracked_resources_get_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "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) + error = _deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.SingletonTrackedResource, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + resource: Union[_models.SingletonTrackedResource, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_singleton_tracked_resources_create_or_update_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + 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, 201]: + 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) + error = _deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + resource: _models.SingletonTrackedResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.SingletonTrackedResource]: + """Create a SingletonTrackedResource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.resourcemanager.models.resources.models.SingletonTrackedResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns SingletonTrackedResource. The + SingletonTrackedResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.resourcemanager.models.resources.models.SingletonTrackedResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, resource_group_name: str, resource: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> AsyncLROPoller[_models.SingletonTrackedResource]: + """Create a SingletonTrackedResource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource: Resource create parameters. Required. + :type resource: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns SingletonTrackedResource. The + SingletonTrackedResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.resourcemanager.models.resources.models.SingletonTrackedResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, resource_group_name: str, resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> AsyncLROPoller[_models.SingletonTrackedResource]: + """Create a SingletonTrackedResource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource: Resource create parameters. Required. + :type resource: 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: An instance of AsyncLROPoller that returns SingletonTrackedResource. The + SingletonTrackedResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.resourcemanager.models.resources.models.SingletonTrackedResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + resource: Union[_models.SingletonTrackedResource, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.SingletonTrackedResource]: + """Create a SingletonTrackedResource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource: Resource create parameters. Is one of the following types: + SingletonTrackedResource, JSON, IO[bytes] Required. + :type resource: ~azure.resourcemanager.models.resources.models.SingletonTrackedResource or JSON + or IO[bytes] + :return: An instance of AsyncLROPoller that returns SingletonTrackedResource. The + SingletonTrackedResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.resourcemanager.models.resources.models.SingletonTrackedResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _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[_models.SingletonTrackedResource] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + resource=resource, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.SingletonTrackedResource, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.SingletonTrackedResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.SingletonTrackedResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + async def update( + self, + resource_group_name: str, + properties: _models.SingletonTrackedResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SingletonTrackedResource: + """Update a SingletonTrackedResource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.resourcemanager.models.resources.models.SingletonTrackedResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SingletonTrackedResource. The SingletonTrackedResource is compatible with + MutableMapping + :rtype: ~azure.resourcemanager.models.resources.models.SingletonTrackedResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update( + self, resource_group_name: str, properties: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.SingletonTrackedResource: + """Update a SingletonTrackedResource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param properties: The resource properties to be updated. Required. + :type properties: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SingletonTrackedResource. The SingletonTrackedResource is compatible with + MutableMapping + :rtype: ~azure.resourcemanager.models.resources.models.SingletonTrackedResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update( + self, resource_group_name: str, properties: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.SingletonTrackedResource: + """Update a SingletonTrackedResource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param properties: The resource properties to be updated. Required. + :type properties: 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: SingletonTrackedResource. The SingletonTrackedResource is compatible with + MutableMapping + :rtype: ~azure.resourcemanager.models.resources.models.SingletonTrackedResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update( + self, + resource_group_name: str, + properties: Union[_models.SingletonTrackedResource, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.SingletonTrackedResource: + """Update a SingletonTrackedResource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param properties: The resource properties to be updated. Is one of the following types: + SingletonTrackedResource, JSON, IO[bytes] Required. + :type properties: ~azure.resourcemanager.models.resources.models.SingletonTrackedResource or + JSON or IO[bytes] + :return: SingletonTrackedResource. The SingletonTrackedResource is compatible with + MutableMapping + :rtype: ~azure.resourcemanager.models.resources.models.SingletonTrackedResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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[_models.SingletonTrackedResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(properties, (IOBase, bytes)): + _content = properties + else: + _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_singleton_tracked_resources_update_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "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) + error = _deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.SingletonTrackedResource, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_resource_group( + self, resource_group_name: str, **kwargs: Any + ) -> AsyncIterable["_models.SingletonTrackedResource"]: + """List SingletonTrackedResource resources by resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of SingletonTrackedResource + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.resourcemanager.models.resources.models.SingletonTrackedResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.SingletonTrackedResource]] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_singleton_tracked_resources_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.SingletonTrackedResource], deserialized["value"]) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) diff --git a/packages/typespec-python/test/azure/generated/azure-resource-manager-models-resources/azure/resourcemanager/models/resources/models/__init__.py b/packages/typespec-python/test/azure/generated/azure-resource-manager-models-resources/azure/resourcemanager/models/resources/models/__init__.py index 22a220bac00..cdcbbd6d9e2 100644 --- a/packages/typespec-python/test/azure/generated/azure-resource-manager-models-resources/azure/resourcemanager/models/resources/models/__init__.py +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-models-resources/azure/resourcemanager/models/resources/models/__init__.py @@ -14,6 +14,8 @@ from ._models import NotificationDetails from ._models import ProxyResource from ._models import Resource +from ._models import SingletonTrackedResource +from ._models import SingletonTrackedResourceProperties from ._models import SystemData from ._models import TopLevelTrackedResource from ._models import TopLevelTrackedResourceProperties @@ -34,6 +36,8 @@ "NotificationDetails", "ProxyResource", "Resource", + "SingletonTrackedResource", + "SingletonTrackedResourceProperties", "SystemData", "TopLevelTrackedResource", "TopLevelTrackedResourceProperties", diff --git a/packages/typespec-python/test/azure/generated/azure-resource-manager-models-resources/azure/resourcemanager/models/resources/models/_models.py b/packages/typespec-python/test/azure/generated/azure-resource-manager-models-resources/azure/resourcemanager/models/resources/models/_models.py index 6eded9a0f6b..ba5020a97dd 100644 --- a/packages/typespec-python/test/azure/generated/azure-resource-manager-models-resources/azure/resourcemanager/models/resources/models/_models.py +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-models-resources/azure/resourcemanager/models/resources/models/_models.py @@ -262,51 +262,41 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useles super().__init__(*args, **kwargs) -class SystemData(_model_base.Model): - """Metadata pertaining to creation and last modification of the resource. +class TrackedResource(Resource): + """The resource model definition for an Azure Resource Manager tracked top level resource which + has 'tags' and a 'location'. - :ivar created_by: The identity that created the resource. - :vartype created_by: str - :ivar created_by_type: The type of identity that created the resource. Known values are: - "User", "Application", "ManagedIdentity", and "Key". - :vartype created_by_type: str or ~azure.resourcemanager.models.resources.models.CreatedByType - :ivar created_at: The timestamp of resource creation (UTC). - :vartype created_at: ~datetime.datetime - :ivar last_modified_by: The identity that last modified the resource. - :vartype last_modified_by: str - :ivar last_modified_by_type: The type of identity that last modified the resource. Known values - are: "User", "Application", "ManagedIdentity", and "Key". - :vartype last_modified_by_type: str or - ~azure.resourcemanager.models.resources.models.CreatedByType - :ivar last_modified_at: The timestamp of resource last modification (UTC). - :vartype last_modified_at: ~datetime.datetime + Readonly variables are only populated by the server, and will be ignored when sending a request. + + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.resourcemanager.models.resources.models.SystemData + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str """ - created_by: Optional[str] = rest_field(name="createdBy") - """The identity that created the resource.""" - created_by_type: Optional[Union[str, "_models.CreatedByType"]] = rest_field(name="createdByType") - """The type of identity that created the resource. Known values are: \"User\", \"Application\", - \"ManagedIdentity\", and \"Key\".""" - created_at: Optional[datetime.datetime] = rest_field(name="createdAt", format="rfc3339") - """The timestamp of resource creation (UTC).""" - last_modified_by: Optional[str] = rest_field(name="lastModifiedBy") - """The identity that last modified the resource.""" - last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = rest_field(name="lastModifiedByType") - """The type of identity that last modified the resource. Known values are: \"User\", - \"Application\", \"ManagedIdentity\", and \"Key\".""" - last_modified_at: Optional[datetime.datetime] = rest_field(name="lastModifiedAt", format="rfc3339") - """The timestamp of resource last modification (UTC).""" + tags: Optional[Dict[str, str]] = rest_field() + """Resource tags.""" + location: str = rest_field(visibility=["read", "create"]) + """The geo-location where the resource lives. Required.""" @overload def __init__( self, *, - created_by: Optional[str] = None, - created_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, - created_at: Optional[datetime.datetime] = None, - last_modified_by: Optional[str] = None, - last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, - last_modified_at: Optional[datetime.datetime] = None, + location: str, + tags: Optional[Dict[str, str]] = None, ): ... @overload @@ -320,9 +310,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useles super().__init__(*args, **kwargs) -class TrackedResource(Resource): - """The resource model definition for an Azure Resource Manager tracked top level resource which - has 'tags' and a 'location'. +class SingletonTrackedResource(TrackedResource): + """Concrete tracked resource types can be created by aliasing this type using a specific property + type. Readonly variables are only populated by the server, and will be ignored when sending a request. @@ -342,12 +332,13 @@ class TrackedResource(Resource): :vartype tags: dict[str, str] :ivar location: The geo-location where the resource lives. Required. :vartype location: str + :ivar properties: The resource-specific properties for this resource. + :vartype properties: + ~azure.resourcemanager.models.resources.models.SingletonTrackedResourceProperties """ - tags: Optional[Dict[str, str]] = rest_field() - """Resource tags.""" - location: str = rest_field(visibility=["read", "create"]) - """The geo-location where the resource lives. Required.""" + properties: Optional["_models.SingletonTrackedResourceProperties"] = rest_field() + """The resource-specific properties for this resource.""" @overload def __init__( @@ -355,6 +346,104 @@ def __init__( *, location: str, tags: Optional[Dict[str, str]] = None, + properties: Optional["_models.SingletonTrackedResourceProperties"] = None, + ): ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + + +class SingletonTrackedResourceProperties(_model_base.Model): + """Singleton Arm Resource Properties. + + Readonly variables are only populated by the server, and will be ignored when sending a request. + + :ivar provisioning_state: The status of the last operation. Known values are: "Succeeded", + "Failed", "Canceled", "Provisioning", "Updating", "Deleting", and "Accepted". + :vartype provisioning_state: str or + ~azure.resourcemanager.models.resources.models.ProvisioningState + :ivar description: The description of the resource. + :vartype description: str + """ + + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """The status of the last operation. Known values are: \"Succeeded\", \"Failed\", \"Canceled\", + \"Provisioning\", \"Updating\", \"Deleting\", and \"Accepted\".""" + description: Optional[str] = rest_field() + """The description of the resource.""" + + @overload + def __init__( + self, + *, + description: Optional[str] = None, + ): ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + + +class SystemData(_model_base.Model): + """Metadata pertaining to creation and last modification of the resource. + + :ivar created_by: The identity that created the resource. + :vartype created_by: str + :ivar created_by_type: The type of identity that created the resource. Known values are: + "User", "Application", "ManagedIdentity", and "Key". + :vartype created_by_type: str or ~azure.resourcemanager.models.resources.models.CreatedByType + :ivar created_at: The timestamp of resource creation (UTC). + :vartype created_at: ~datetime.datetime + :ivar last_modified_by: The identity that last modified the resource. + :vartype last_modified_by: str + :ivar last_modified_by_type: The type of identity that last modified the resource. Known values + are: "User", "Application", "ManagedIdentity", and "Key". + :vartype last_modified_by_type: str or + ~azure.resourcemanager.models.resources.models.CreatedByType + :ivar last_modified_at: The timestamp of resource last modification (UTC). + :vartype last_modified_at: ~datetime.datetime + """ + + created_by: Optional[str] = rest_field(name="createdBy") + """The identity that created the resource.""" + created_by_type: Optional[Union[str, "_models.CreatedByType"]] = rest_field(name="createdByType") + """The type of identity that created the resource. Known values are: \"User\", \"Application\", + \"ManagedIdentity\", and \"Key\".""" + created_at: Optional[datetime.datetime] = rest_field(name="createdAt", format="rfc3339") + """The timestamp of resource creation (UTC).""" + last_modified_by: Optional[str] = rest_field(name="lastModifiedBy") + """The identity that last modified the resource.""" + last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = rest_field(name="lastModifiedByType") + """The type of identity that last modified the resource. Known values are: \"User\", + \"Application\", \"ManagedIdentity\", and \"Key\".""" + last_modified_at: Optional[datetime.datetime] = rest_field(name="lastModifiedAt", format="rfc3339") + """The timestamp of resource last modification (UTC).""" + + @overload + def __init__( + self, + *, + created_by: Optional[str] = None, + created_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, + created_at: Optional[datetime.datetime] = None, + last_modified_by: Optional[str] = None, + last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, + last_modified_at: Optional[datetime.datetime] = None, ): ... @overload diff --git a/packages/typespec-python/test/azure/generated/azure-resource-manager-models-resources/azure/resourcemanager/models/resources/operations/__init__.py b/packages/typespec-python/test/azure/generated/azure-resource-manager-models-resources/azure/resourcemanager/models/resources/operations/__init__.py index 23b474954f8..56026fc797b 100644 --- a/packages/typespec-python/test/azure/generated/azure-resource-manager-models-resources/azure/resourcemanager/models/resources/operations/__init__.py +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-models-resources/azure/resourcemanager/models/resources/operations/__init__.py @@ -8,6 +8,7 @@ from ._operations import TopLevelTrackedResourcesOperations from ._operations import NestedProxyResourcesOperations +from ._operations import SingletonTrackedResourcesOperations from ._patch import __all__ as _patch_all from ._patch import * # pylint: disable=unused-wildcard-import @@ -16,6 +17,7 @@ __all__ = [ "TopLevelTrackedResourcesOperations", "NestedProxyResourcesOperations", + "SingletonTrackedResourcesOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/azure-resource-manager-models-resources/azure/resourcemanager/models/resources/operations/_operations.py b/packages/typespec-python/test/azure/generated/azure-resource-manager-models-resources/azure/resourcemanager/models/resources/operations/_operations.py index eb06c55a782..505067916c4 100644 --- a/packages/typespec-python/test/azure/generated/azure-resource-manager-models-resources/azure/resourcemanager/models/resources/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-models-resources/azure/resourcemanager/models/resources/operations/_operations.py @@ -435,6 +435,120 @@ def build_nested_proxy_resources_list_by_top_level_tracked_resource_request( # return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) +def build_singleton_tracked_resources_get_by_resource_group_request( # pylint: disable=name-too-long + resource_group_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Azure.ResourceManager.Models.Resources/singletonTrackedResources/default" # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_singleton_tracked_resources_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Azure.ResourceManager.Models.Resources/singletonTrackedResources/default" # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # 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="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_singleton_tracked_resources_update_request( # pylint: disable=name-too-long + resource_group_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Azure.ResourceManager.Models.Resources/singletonTrackedResources/default" # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # 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="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_singleton_tracked_resources_list_by_resource_group_request( # pylint: disable=name-too-long + resource_group_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-12-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Azure.ResourceManager.Models.Resources/singletonTrackedResources" # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + class TopLevelTrackedResourcesOperations: """ .. warning:: @@ -2255,3 +2369,536 @@ def get_next(next_link=None): return pipeline_response return ItemPaged(get_next, extract_data) + + +class SingletonTrackedResourcesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.resourcemanager.models.resources.ResourcesClient`'s + :attr:`singleton_tracked_resources` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> _models.SingletonTrackedResource: + """Get a SingletonTrackedResource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: SingletonTrackedResource. The SingletonTrackedResource is compatible with + MutableMapping + :rtype: ~azure.resourcemanager.models.resources.models.SingletonTrackedResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.SingletonTrackedResource] = kwargs.pop("cls", None) + + _request = build_singleton_tracked_resources_get_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "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) + error = _deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.SingletonTrackedResource, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + resource: Union[_models.SingletonTrackedResource, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(resource, (IOBase, bytes)): + _content = resource + else: + _content = json.dumps(resource, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_singleton_tracked_resources_create_or_update_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = True + 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, 201]: + 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) + error = _deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + resource: _models.SingletonTrackedResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.SingletonTrackedResource]: + """Create a SingletonTrackedResource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource: Resource create parameters. Required. + :type resource: ~azure.resourcemanager.models.resources.models.SingletonTrackedResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns SingletonTrackedResource. The + SingletonTrackedResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.resourcemanager.models.resources.models.SingletonTrackedResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, resource_group_name: str, resource: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> LROPoller[_models.SingletonTrackedResource]: + """Create a SingletonTrackedResource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource: Resource create parameters. Required. + :type resource: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns SingletonTrackedResource. The + SingletonTrackedResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.resourcemanager.models.resources.models.SingletonTrackedResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, resource_group_name: str, resource: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> LROPoller[_models.SingletonTrackedResource]: + """Create a SingletonTrackedResource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource: Resource create parameters. Required. + :type resource: 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: An instance of LROPoller that returns SingletonTrackedResource. The + SingletonTrackedResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.resourcemanager.models.resources.models.SingletonTrackedResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + resource: Union[_models.SingletonTrackedResource, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.SingletonTrackedResource]: + """Create a SingletonTrackedResource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param resource: Resource create parameters. Is one of the following types: + SingletonTrackedResource, JSON, IO[bytes] Required. + :type resource: ~azure.resourcemanager.models.resources.models.SingletonTrackedResource or JSON + or IO[bytes] + :return: An instance of LROPoller that returns SingletonTrackedResource. The + SingletonTrackedResource is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.resourcemanager.models.resources.models.SingletonTrackedResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _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[_models.SingletonTrackedResource] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + resource=resource, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.SingletonTrackedResource, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.SingletonTrackedResource].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.SingletonTrackedResource]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + def update( + self, + resource_group_name: str, + properties: _models.SingletonTrackedResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SingletonTrackedResource: + """Update a SingletonTrackedResource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param properties: The resource properties to be updated. Required. + :type properties: ~azure.resourcemanager.models.resources.models.SingletonTrackedResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SingletonTrackedResource. The SingletonTrackedResource is compatible with + MutableMapping + :rtype: ~azure.resourcemanager.models.resources.models.SingletonTrackedResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update( + self, resource_group_name: str, properties: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.SingletonTrackedResource: + """Update a SingletonTrackedResource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param properties: The resource properties to be updated. Required. + :type properties: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SingletonTrackedResource. The SingletonTrackedResource is compatible with + MutableMapping + :rtype: ~azure.resourcemanager.models.resources.models.SingletonTrackedResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update( + self, resource_group_name: str, properties: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.SingletonTrackedResource: + """Update a SingletonTrackedResource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param properties: The resource properties to be updated. Required. + :type properties: 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: SingletonTrackedResource. The SingletonTrackedResource is compatible with + MutableMapping + :rtype: ~azure.resourcemanager.models.resources.models.SingletonTrackedResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update( + self, + resource_group_name: str, + properties: Union[_models.SingletonTrackedResource, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.SingletonTrackedResource: + """Update a SingletonTrackedResource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param properties: The resource properties to be updated. Is one of the following types: + SingletonTrackedResource, JSON, IO[bytes] Required. + :type properties: ~azure.resourcemanager.models.resources.models.SingletonTrackedResource or + JSON or IO[bytes] + :return: SingletonTrackedResource. The SingletonTrackedResource is compatible with + MutableMapping + :rtype: ~azure.resourcemanager.models.resources.models.SingletonTrackedResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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[_models.SingletonTrackedResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(properties, (IOBase, bytes)): + _content = properties + else: + _content = json.dumps(properties, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_singleton_tracked_resources_update_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "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) + error = _deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.SingletonTrackedResource, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_resource_group( + self, resource_group_name: str, **kwargs: Any + ) -> Iterable["_models.SingletonTrackedResource"]: + """List SingletonTrackedResource resources by resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of SingletonTrackedResource + :rtype: + ~azure.core.paging.ItemPaged[~azure.resourcemanager.models.resources.models.SingletonTrackedResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.SingletonTrackedResource]] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_singleton_tracked_resources_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize(List[_models.SingletonTrackedResource], deserialized["value"]) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _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]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) diff --git a/packages/typespec-python/test/azure/generated/azure-resource-manager-models-resources/generated_tests/test_resources_nested_proxy_resources_operations.py b/packages/typespec-python/test/azure/generated/azure-resource-manager-models-resources/generated_tests/test_resources_nested_proxy_resources_operations.py index 2f03500d82c..9cab928cdfe 100644 --- a/packages/typespec-python/test/azure/generated/azure-resource-manager-models-resources/generated_tests/test_resources_nested_proxy_resources_operations.py +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-models-resources/generated_tests/test_resources_nested_proxy_resources_operations.py @@ -20,7 +20,7 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_nested_proxy_resources_get(self, resource_group): response = self.client.nested_proxy_resources.get( resource_group_name=resource_group.name, top_level_tracked_resource_name="str", @@ -32,7 +32,7 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_create_or_replace(self, resource_group): + def test_nested_proxy_resources_begin_create_or_replace(self, resource_group): response = self.client.nested_proxy_resources.begin_create_or_replace( resource_group_name=resource_group.name, top_level_tracked_resource_name="str", @@ -58,7 +58,7 @@ def test_begin_create_or_replace(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_update(self, resource_group): + def test_nested_proxy_resources_begin_update(self, resource_group): response = self.client.nested_proxy_resources.begin_update( resource_group_name=resource_group.name, top_level_tracked_resource_name="str", @@ -84,7 +84,7 @@ def test_begin_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_delete(self, resource_group): + def test_nested_proxy_resources_begin_delete(self, resource_group): response = self.client.nested_proxy_resources.begin_delete( resource_group_name=resource_group.name, top_level_tracked_resource_name="str", @@ -96,7 +96,7 @@ def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_by_top_level_tracked_resource(self, resource_group): + def test_nested_proxy_resources_list_by_top_level_tracked_resource(self, resource_group): response = self.client.nested_proxy_resources.list_by_top_level_tracked_resource( resource_group_name=resource_group.name, top_level_tracked_resource_name="str", diff --git a/packages/typespec-python/test/azure/generated/azure-resource-manager-models-resources/generated_tests/test_resources_nested_proxy_resources_operations_async.py b/packages/typespec-python/test/azure/generated/azure-resource-manager-models-resources/generated_tests/test_resources_nested_proxy_resources_operations_async.py index c6fed64021b..0f043be1eba 100644 --- a/packages/typespec-python/test/azure/generated/azure-resource-manager-models-resources/generated_tests/test_resources_nested_proxy_resources_operations_async.py +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-models-resources/generated_tests/test_resources_nested_proxy_resources_operations_async.py @@ -21,7 +21,7 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_nested_proxy_resources_get(self, resource_group): response = await self.client.nested_proxy_resources.get( resource_group_name=resource_group.name, top_level_tracked_resource_name="str", @@ -33,7 +33,7 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_create_or_replace(self, resource_group): + async def test_nested_proxy_resources_begin_create_or_replace(self, resource_group): response = await ( await self.client.nested_proxy_resources.begin_create_or_replace( resource_group_name=resource_group.name, @@ -61,7 +61,7 @@ async def test_begin_create_or_replace(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_update(self, resource_group): + async def test_nested_proxy_resources_begin_update(self, resource_group): response = await ( await self.client.nested_proxy_resources.begin_update( resource_group_name=resource_group.name, @@ -89,7 +89,7 @@ async def test_begin_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_delete(self, resource_group): + async def test_nested_proxy_resources_begin_delete(self, resource_group): response = await ( await self.client.nested_proxy_resources.begin_delete( resource_group_name=resource_group.name, @@ -103,7 +103,7 @@ async def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_by_top_level_tracked_resource(self, resource_group): + async def test_nested_proxy_resources_list_by_top_level_tracked_resource(self, resource_group): response = self.client.nested_proxy_resources.list_by_top_level_tracked_resource( resource_group_name=resource_group.name, top_level_tracked_resource_name="str", diff --git a/packages/typespec-python/test/azure/generated/azure-resource-manager-models-resources/generated_tests/test_resources_singleton_tracked_resources_operations.py b/packages/typespec-python/test/azure/generated/azure-resource-manager-models-resources/generated_tests/test_resources_singleton_tracked_resources_operations.py new file mode 100644 index 00000000000..03e8cca90ee --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-models-resources/generated_tests/test_resources_singleton_tracked_resources_operations.py @@ -0,0 +1,91 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.resourcemanager.models.resources import ResourcesClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestResourcesSingletonTrackedResourcesOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(ResourcesClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_singleton_tracked_resources_get_by_resource_group(self, resource_group): + response = self.client.singleton_tracked_resources.get_by_resource_group( + resource_group_name=resource_group.name, + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_singleton_tracked_resources_begin_create_or_update(self, resource_group): + response = self.client.singleton_tracked_resources.begin_create_or_update( + resource_group_name=resource_group.name, + resource={ + "location": "str", + "id": "str", + "name": "str", + "properties": {"description": "str", "provisioningState": "str"}, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_singleton_tracked_resources_update(self, resource_group): + response = self.client.singleton_tracked_resources.update( + resource_group_name=resource_group.name, + properties={ + "location": "str", + "id": "str", + "name": "str", + "properties": {"description": "str", "provisioningState": "str"}, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_singleton_tracked_resources_list_by_resource_group(self, resource_group): + response = self.client.singleton_tracked_resources.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/packages/typespec-python/test/azure/generated/azure-resource-manager-models-resources/generated_tests/test_resources_singleton_tracked_resources_operations_async.py b/packages/typespec-python/test/azure/generated/azure-resource-manager-models-resources/generated_tests/test_resources_singleton_tracked_resources_operations_async.py new file mode 100644 index 00000000000..4447dbf71cf --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-models-resources/generated_tests/test_resources_singleton_tracked_resources_operations_async.py @@ -0,0 +1,94 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.resourcemanager.models.resources.aio import ResourcesClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestResourcesSingletonTrackedResourcesOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(ResourcesClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_singleton_tracked_resources_get_by_resource_group(self, resource_group): + response = await self.client.singleton_tracked_resources.get_by_resource_group( + resource_group_name=resource_group.name, + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_singleton_tracked_resources_begin_create_or_update(self, resource_group): + response = await ( + await self.client.singleton_tracked_resources.begin_create_or_update( + resource_group_name=resource_group.name, + resource={ + "location": "str", + "id": "str", + "name": "str", + "properties": {"description": "str", "provisioningState": "str"}, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_singleton_tracked_resources_update(self, resource_group): + response = await self.client.singleton_tracked_resources.update( + resource_group_name=resource_group.name, + properties={ + "location": "str", + "id": "str", + "name": "str", + "properties": {"description": "str", "provisioningState": "str"}, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_singleton_tracked_resources_list_by_resource_group(self, resource_group): + response = self.client.singleton_tracked_resources.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/packages/typespec-python/test/azure/generated/azure-resource-manager-models-resources/generated_tests/test_resources_top_level_tracked_resources_operations.py b/packages/typespec-python/test/azure/generated/azure-resource-manager-models-resources/generated_tests/test_resources_top_level_tracked_resources_operations.py index cf7ea85c2af..5c8ab902b80 100644 --- a/packages/typespec-python/test/azure/generated/azure-resource-manager-models-resources/generated_tests/test_resources_top_level_tracked_resources_operations.py +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-models-resources/generated_tests/test_resources_top_level_tracked_resources_operations.py @@ -20,7 +20,7 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_get(self, resource_group): + def test_top_level_tracked_resources_get(self, resource_group): response = self.client.top_level_tracked_resources.get( resource_group_name=resource_group.name, top_level_tracked_resource_name="str", @@ -31,7 +31,7 @@ def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_create_or_replace(self, resource_group): + def test_top_level_tracked_resources_begin_create_or_replace(self, resource_group): response = self.client.top_level_tracked_resources.begin_create_or_replace( resource_group_name=resource_group.name, top_level_tracked_resource_name="str", @@ -58,7 +58,7 @@ def test_begin_create_or_replace(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_update(self, resource_group): + def test_top_level_tracked_resources_begin_update(self, resource_group): response = self.client.top_level_tracked_resources.begin_update( resource_group_name=resource_group.name, top_level_tracked_resource_name="str", @@ -85,7 +85,7 @@ def test_begin_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_delete(self, resource_group): + def test_top_level_tracked_resources_begin_delete(self, resource_group): response = self.client.top_level_tracked_resources.begin_delete( resource_group_name=resource_group.name, top_level_tracked_resource_name="str", @@ -96,7 +96,7 @@ def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_by_resource_group(self, resource_group): + def test_top_level_tracked_resources_list_by_resource_group(self, resource_group): response = self.client.top_level_tracked_resources.list_by_resource_group( resource_group_name=resource_group.name, ) @@ -106,7 +106,7 @@ def test_list_by_resource_group(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_list_by_subscription(self, resource_group): + def test_top_level_tracked_resources_list_by_subscription(self, resource_group): response = self.client.top_level_tracked_resources.list_by_subscription() result = [r for r in response] # please add some check logic here by yourself @@ -114,7 +114,7 @@ def test_list_by_subscription(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_action_sync(self, resource_group): + def test_top_level_tracked_resources_action_sync(self, resource_group): response = self.client.top_level_tracked_resources.action_sync( resource_group_name=resource_group.name, top_level_tracked_resource_name="str", diff --git a/packages/typespec-python/test/azure/generated/azure-resource-manager-models-resources/generated_tests/test_resources_top_level_tracked_resources_operations_async.py b/packages/typespec-python/test/azure/generated/azure-resource-manager-models-resources/generated_tests/test_resources_top_level_tracked_resources_operations_async.py index d44f3a6ac30..01a14db86b0 100644 --- a/packages/typespec-python/test/azure/generated/azure-resource-manager-models-resources/generated_tests/test_resources_top_level_tracked_resources_operations_async.py +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-models-resources/generated_tests/test_resources_top_level_tracked_resources_operations_async.py @@ -21,7 +21,7 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_get(self, resource_group): + async def test_top_level_tracked_resources_get(self, resource_group): response = await self.client.top_level_tracked_resources.get( resource_group_name=resource_group.name, top_level_tracked_resource_name="str", @@ -32,7 +32,7 @@ async def test_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_create_or_replace(self, resource_group): + async def test_top_level_tracked_resources_begin_create_or_replace(self, resource_group): response = await ( await self.client.top_level_tracked_resources.begin_create_or_replace( resource_group_name=resource_group.name, @@ -61,7 +61,7 @@ async def test_begin_create_or_replace(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_update(self, resource_group): + async def test_top_level_tracked_resources_begin_update(self, resource_group): response = await ( await self.client.top_level_tracked_resources.begin_update( resource_group_name=resource_group.name, @@ -90,7 +90,7 @@ async def test_begin_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_delete(self, resource_group): + async def test_top_level_tracked_resources_begin_delete(self, resource_group): response = await ( await self.client.top_level_tracked_resources.begin_delete( resource_group_name=resource_group.name, @@ -103,7 +103,7 @@ async def test_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_by_resource_group(self, resource_group): + async def test_top_level_tracked_resources_list_by_resource_group(self, resource_group): response = self.client.top_level_tracked_resources.list_by_resource_group( resource_group_name=resource_group.name, ) @@ -113,7 +113,7 @@ async def test_list_by_resource_group(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_list_by_subscription(self, resource_group): + async def test_top_level_tracked_resources_list_by_subscription(self, resource_group): response = self.client.top_level_tracked_resources.list_by_subscription() result = [r async for r in response] # please add some check logic here by yourself @@ -121,7 +121,7 @@ async def test_list_by_subscription(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_action_sync(self, resource_group): + async def test_top_level_tracked_resources_action_sync(self, resource_group): response = await self.client.top_level_tracked_resources.action_sync( resource_group_name=resource_group.name, top_level_tracked_resource_name="str", diff --git a/packages/typespec-python/test/azure/generated/client-naming/generated_tests/test_naming_client_model_operations.py b/packages/typespec-python/test/azure/generated/client-naming/generated_tests/test_naming_client_model_operations.py index 932b32ae449..854de9bc234 100644 --- a/packages/typespec-python/test/azure/generated/client-naming/generated_tests/test_naming_client_model_operations.py +++ b/packages/typespec-python/test/azure/generated/client-naming/generated_tests/test_naming_client_model_operations.py @@ -14,7 +14,7 @@ class TestNamingClientModelOperations(NamingClientTestBase): @NamingPreparer() @recorded_by_proxy - def test_client(self, naming_endpoint): + def test_client_model_client(self, naming_endpoint): client = self.create_client(endpoint=naming_endpoint) response = client.client_model.client( body={"defaultName": bool}, @@ -25,7 +25,7 @@ def test_client(self, naming_endpoint): @NamingPreparer() @recorded_by_proxy - def test_language(self, naming_endpoint): + def test_client_model_language(self, naming_endpoint): client = self.create_client(endpoint=naming_endpoint) response = client.client_model.language( body={"defaultName": bool}, diff --git a/packages/typespec-python/test/azure/generated/client-naming/generated_tests/test_naming_client_model_operations_async.py b/packages/typespec-python/test/azure/generated/client-naming/generated_tests/test_naming_client_model_operations_async.py index d3fbd1342c3..ef1c0109021 100644 --- a/packages/typespec-python/test/azure/generated/client-naming/generated_tests/test_naming_client_model_operations_async.py +++ b/packages/typespec-python/test/azure/generated/client-naming/generated_tests/test_naming_client_model_operations_async.py @@ -15,7 +15,7 @@ class TestNamingClientModelOperationsAsync(NamingClientTestBaseAsync): @NamingPreparer() @recorded_by_proxy_async - async def test_client(self, naming_endpoint): + async def test_client_model_client(self, naming_endpoint): client = self.create_async_client(endpoint=naming_endpoint) response = await client.client_model.client( body={"defaultName": bool}, @@ -26,7 +26,7 @@ async def test_client(self, naming_endpoint): @NamingPreparer() @recorded_by_proxy_async - async def test_language(self, naming_endpoint): + async def test_client_model_language(self, naming_endpoint): client = self.create_async_client(endpoint=naming_endpoint) response = await client.client_model.language( body={"defaultName": bool}, diff --git a/packages/typespec-python/test/azure/generated/client-naming/generated_tests/test_naming_union_enum_operations.py b/packages/typespec-python/test/azure/generated/client-naming/generated_tests/test_naming_union_enum_operations.py index 02c9ce87cb2..45e18f9ddc8 100644 --- a/packages/typespec-python/test/azure/generated/client-naming/generated_tests/test_naming_union_enum_operations.py +++ b/packages/typespec-python/test/azure/generated/client-naming/generated_tests/test_naming_union_enum_operations.py @@ -14,7 +14,7 @@ class TestNamingUnionEnumOperations(NamingClientTestBase): @NamingPreparer() @recorded_by_proxy - def test_union_enum_name(self, naming_endpoint): + def test_union_enum_union_enum_name(self, naming_endpoint): client = self.create_client(endpoint=naming_endpoint) response = client.union_enum.union_enum_name( body="str", @@ -26,7 +26,7 @@ def test_union_enum_name(self, naming_endpoint): @NamingPreparer() @recorded_by_proxy - def test_union_enum_member_name(self, naming_endpoint): + def test_union_enum_union_enum_member_name(self, naming_endpoint): client = self.create_client(endpoint=naming_endpoint) response = client.union_enum.union_enum_member_name( body="str", diff --git a/packages/typespec-python/test/azure/generated/client-naming/generated_tests/test_naming_union_enum_operations_async.py b/packages/typespec-python/test/azure/generated/client-naming/generated_tests/test_naming_union_enum_operations_async.py index b540a2d9b16..141e125b601 100644 --- a/packages/typespec-python/test/azure/generated/client-naming/generated_tests/test_naming_union_enum_operations_async.py +++ b/packages/typespec-python/test/azure/generated/client-naming/generated_tests/test_naming_union_enum_operations_async.py @@ -15,7 +15,7 @@ class TestNamingUnionEnumOperationsAsync(NamingClientTestBaseAsync): @NamingPreparer() @recorded_by_proxy_async - async def test_union_enum_name(self, naming_endpoint): + async def test_union_enum_union_enum_name(self, naming_endpoint): client = self.create_async_client(endpoint=naming_endpoint) response = await client.union_enum.union_enum_name( body="str", @@ -27,7 +27,7 @@ async def test_union_enum_name(self, naming_endpoint): @NamingPreparer() @recorded_by_proxy_async - async def test_union_enum_member_name(self, naming_endpoint): + async def test_union_enum_union_enum_member_name(self, naming_endpoint): client = self.create_async_client(endpoint=naming_endpoint) response = await client.union_enum.union_enum_member_name( body="str", diff --git a/packages/typespec-python/test/azure/generated/client-structure-default/generated_tests/test_service_bar_operations.py b/packages/typespec-python/test/azure/generated/client-structure-default/generated_tests/test_service_bar_operations.py index 0fcbbf7ef79..ca4600e7c2c 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-default/generated_tests/test_service_bar_operations.py +++ b/packages/typespec-python/test/azure/generated/client-structure-default/generated_tests/test_service_bar_operations.py @@ -14,7 +14,7 @@ class TestServiceBarOperations(ServiceClientTestBase): @ServicePreparer() @recorded_by_proxy - def test_five(self, service_endpoint): + def test_bar_five(self, service_endpoint): client = self.create_client(endpoint=service_endpoint) response = client.bar.five() @@ -23,7 +23,7 @@ def test_five(self, service_endpoint): @ServicePreparer() @recorded_by_proxy - def test_six(self, service_endpoint): + def test_bar_six(self, service_endpoint): client = self.create_client(endpoint=service_endpoint) response = client.bar.six() diff --git a/packages/typespec-python/test/azure/generated/client-structure-default/generated_tests/test_service_bar_operations_async.py b/packages/typespec-python/test/azure/generated/client-structure-default/generated_tests/test_service_bar_operations_async.py index 0ea8e036af6..563b02c2ac8 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-default/generated_tests/test_service_bar_operations_async.py +++ b/packages/typespec-python/test/azure/generated/client-structure-default/generated_tests/test_service_bar_operations_async.py @@ -15,7 +15,7 @@ class TestServiceBarOperationsAsync(ServiceClientTestBaseAsync): @ServicePreparer() @recorded_by_proxy_async - async def test_five(self, service_endpoint): + async def test_bar_five(self, service_endpoint): client = self.create_async_client(endpoint=service_endpoint) response = await client.bar.five() @@ -24,7 +24,7 @@ async def test_five(self, service_endpoint): @ServicePreparer() @recorded_by_proxy_async - async def test_six(self, service_endpoint): + async def test_bar_six(self, service_endpoint): client = self.create_async_client(endpoint=service_endpoint) response = await client.bar.six() diff --git a/packages/typespec-python/test/azure/generated/client-structure-default/generated_tests/test_service_baz_operations.py b/packages/typespec-python/test/azure/generated/client-structure-default/generated_tests/test_service_baz_operations.py index da024e29ed2..25e68492cd5 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-default/generated_tests/test_service_baz_operations.py +++ b/packages/typespec-python/test/azure/generated/client-structure-default/generated_tests/test_service_baz_operations.py @@ -14,7 +14,7 @@ class TestServiceBazOperations(ServiceClientTestBase): @ServicePreparer() @recorded_by_proxy - def test_seven(self, service_endpoint): + def test_baz_foo_seven(self, service_endpoint): client = self.create_client(endpoint=service_endpoint) response = client.baz.foo.seven() diff --git a/packages/typespec-python/test/azure/generated/client-structure-default/generated_tests/test_service_baz_operations_async.py b/packages/typespec-python/test/azure/generated/client-structure-default/generated_tests/test_service_baz_operations_async.py index 84dd5925fb3..6fc9529df7e 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-default/generated_tests/test_service_baz_operations_async.py +++ b/packages/typespec-python/test/azure/generated/client-structure-default/generated_tests/test_service_baz_operations_async.py @@ -15,7 +15,7 @@ class TestServiceBazOperationsAsync(ServiceClientTestBaseAsync): @ServicePreparer() @recorded_by_proxy_async - async def test_seven(self, service_endpoint): + async def test_baz_foo_seven(self, service_endpoint): client = self.create_async_client(endpoint=service_endpoint) response = await client.baz.foo.seven() diff --git a/packages/typespec-python/test/azure/generated/client-structure-default/generated_tests/test_service_foo_operations.py b/packages/typespec-python/test/azure/generated/client-structure-default/generated_tests/test_service_foo_operations.py index 8cd81049bc2..5a62fa3eed0 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-default/generated_tests/test_service_foo_operations.py +++ b/packages/typespec-python/test/azure/generated/client-structure-default/generated_tests/test_service_foo_operations.py @@ -14,7 +14,7 @@ class TestServiceFooOperations(ServiceClientTestBase): @ServicePreparer() @recorded_by_proxy - def test_three(self, service_endpoint): + def test_foo_three(self, service_endpoint): client = self.create_client(endpoint=service_endpoint) response = client.foo.three() @@ -23,7 +23,7 @@ def test_three(self, service_endpoint): @ServicePreparer() @recorded_by_proxy - def test_four(self, service_endpoint): + def test_foo_four(self, service_endpoint): client = self.create_client(endpoint=service_endpoint) response = client.foo.four() diff --git a/packages/typespec-python/test/azure/generated/client-structure-default/generated_tests/test_service_foo_operations_async.py b/packages/typespec-python/test/azure/generated/client-structure-default/generated_tests/test_service_foo_operations_async.py index de9deb40bb3..547fc58c746 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-default/generated_tests/test_service_foo_operations_async.py +++ b/packages/typespec-python/test/azure/generated/client-structure-default/generated_tests/test_service_foo_operations_async.py @@ -15,7 +15,7 @@ class TestServiceFooOperationsAsync(ServiceClientTestBaseAsync): @ServicePreparer() @recorded_by_proxy_async - async def test_three(self, service_endpoint): + async def test_foo_three(self, service_endpoint): client = self.create_async_client(endpoint=service_endpoint) response = await client.foo.three() @@ -24,7 +24,7 @@ async def test_three(self, service_endpoint): @ServicePreparer() @recorded_by_proxy_async - async def test_four(self, service_endpoint): + async def test_foo_four(self, service_endpoint): client = self.create_async_client(endpoint=service_endpoint) response = await client.foo.four() diff --git a/packages/typespec-python/test/azure/generated/client-structure-default/generated_tests/test_service_qux_operations.py b/packages/typespec-python/test/azure/generated/client-structure-default/generated_tests/test_service_qux_operations.py index e54f7920ccb..19079ec2a92 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-default/generated_tests/test_service_qux_operations.py +++ b/packages/typespec-python/test/azure/generated/client-structure-default/generated_tests/test_service_qux_operations.py @@ -14,7 +14,7 @@ class TestServiceQuxOperations(ServiceClientTestBase): @ServicePreparer() @recorded_by_proxy - def test_eight(self, service_endpoint): + def test_qux_eight(self, service_endpoint): client = self.create_client(endpoint=service_endpoint) response = client.qux.eight() @@ -23,7 +23,7 @@ def test_eight(self, service_endpoint): @ServicePreparer() @recorded_by_proxy - def test_nine(self, service_endpoint): + def test_qux_bar_nine(self, service_endpoint): client = self.create_client(endpoint=service_endpoint) response = client.qux.bar.nine() diff --git a/packages/typespec-python/test/azure/generated/client-structure-default/generated_tests/test_service_qux_operations_async.py b/packages/typespec-python/test/azure/generated/client-structure-default/generated_tests/test_service_qux_operations_async.py index dfb66534a9b..4eb28c55ad0 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-default/generated_tests/test_service_qux_operations_async.py +++ b/packages/typespec-python/test/azure/generated/client-structure-default/generated_tests/test_service_qux_operations_async.py @@ -15,7 +15,7 @@ class TestServiceQuxOperationsAsync(ServiceClientTestBaseAsync): @ServicePreparer() @recorded_by_proxy_async - async def test_eight(self, service_endpoint): + async def test_qux_eight(self, service_endpoint): client = self.create_async_client(endpoint=service_endpoint) response = await client.qux.eight() @@ -24,7 +24,7 @@ async def test_eight(self, service_endpoint): @ServicePreparer() @recorded_by_proxy_async - async def test_nine(self, service_endpoint): + async def test_qux_bar_nine(self, service_endpoint): client = self.create_async_client(endpoint=service_endpoint) response = await client.qux.bar.nine() diff --git a/packages/typespec-python/test/azure/generated/client-structure-renamedoperation/generated_tests/test_renamed_operation_group_operations.py b/packages/typespec-python/test/azure/generated/client-structure-renamedoperation/generated_tests/test_renamed_operation_group_operations.py index b4fb719e766..bba0c3a932d 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-renamedoperation/generated_tests/test_renamed_operation_group_operations.py +++ b/packages/typespec-python/test/azure/generated/client-structure-renamedoperation/generated_tests/test_renamed_operation_group_operations.py @@ -14,7 +14,7 @@ class TestRenamedOperationGroupOperations(RenamedOperationClientTestBase): @RenamedOperationPreparer() @recorded_by_proxy - def test_renamed_two(self, renamedoperation_endpoint): + def test_group_renamed_two(self, renamedoperation_endpoint): client = self.create_client(endpoint=renamedoperation_endpoint) response = client.group.renamed_two() @@ -23,7 +23,7 @@ def test_renamed_two(self, renamedoperation_endpoint): @RenamedOperationPreparer() @recorded_by_proxy - def test_renamed_four(self, renamedoperation_endpoint): + def test_group_renamed_four(self, renamedoperation_endpoint): client = self.create_client(endpoint=renamedoperation_endpoint) response = client.group.renamed_four() @@ -32,7 +32,7 @@ def test_renamed_four(self, renamedoperation_endpoint): @RenamedOperationPreparer() @recorded_by_proxy - def test_renamed_six(self, renamedoperation_endpoint): + def test_group_renamed_six(self, renamedoperation_endpoint): client = self.create_client(endpoint=renamedoperation_endpoint) response = client.group.renamed_six() diff --git a/packages/typespec-python/test/azure/generated/client-structure-renamedoperation/generated_tests/test_renamed_operation_group_operations_async.py b/packages/typespec-python/test/azure/generated/client-structure-renamedoperation/generated_tests/test_renamed_operation_group_operations_async.py index 0ac8e6aabde..5ce2eb78017 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-renamedoperation/generated_tests/test_renamed_operation_group_operations_async.py +++ b/packages/typespec-python/test/azure/generated/client-structure-renamedoperation/generated_tests/test_renamed_operation_group_operations_async.py @@ -15,7 +15,7 @@ class TestRenamedOperationGroupOperationsAsync(RenamedOperationClientTestBaseAsync): @RenamedOperationPreparer() @recorded_by_proxy_async - async def test_renamed_two(self, renamedoperation_endpoint): + async def test_group_renamed_two(self, renamedoperation_endpoint): client = self.create_async_client(endpoint=renamedoperation_endpoint) response = await client.group.renamed_two() @@ -24,7 +24,7 @@ async def test_renamed_two(self, renamedoperation_endpoint): @RenamedOperationPreparer() @recorded_by_proxy_async - async def test_renamed_four(self, renamedoperation_endpoint): + async def test_group_renamed_four(self, renamedoperation_endpoint): client = self.create_async_client(endpoint=renamedoperation_endpoint) response = await client.group.renamed_four() @@ -33,7 +33,7 @@ async def test_renamed_four(self, renamedoperation_endpoint): @RenamedOperationPreparer() @recorded_by_proxy_async - async def test_renamed_six(self, renamedoperation_endpoint): + async def test_group_renamed_six(self, renamedoperation_endpoint): client = self.create_async_client(endpoint=renamedoperation_endpoint) response = await client.group.renamed_six() diff --git a/packages/typespec-python/test/azure/generated/client-structure-twooperationgroup/generated_tests/test_two_operation_group_group1_operations.py b/packages/typespec-python/test/azure/generated/client-structure-twooperationgroup/generated_tests/test_two_operation_group_group1_operations.py index 11a93d96b04..c3c32ec56f0 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-twooperationgroup/generated_tests/test_two_operation_group_group1_operations.py +++ b/packages/typespec-python/test/azure/generated/client-structure-twooperationgroup/generated_tests/test_two_operation_group_group1_operations.py @@ -14,7 +14,7 @@ class TestTwoOperationGroupGroup1Operations(TwoOperationGroupClientTestBase): @TwoOperationGroupPreparer() @recorded_by_proxy - def test_one(self, twooperationgroup_endpoint): + def test_group1_one(self, twooperationgroup_endpoint): client = self.create_client(endpoint=twooperationgroup_endpoint) response = client.group1.one() @@ -23,7 +23,7 @@ def test_one(self, twooperationgroup_endpoint): @TwoOperationGroupPreparer() @recorded_by_proxy - def test_three(self, twooperationgroup_endpoint): + def test_group1_three(self, twooperationgroup_endpoint): client = self.create_client(endpoint=twooperationgroup_endpoint) response = client.group1.three() @@ -32,7 +32,7 @@ def test_three(self, twooperationgroup_endpoint): @TwoOperationGroupPreparer() @recorded_by_proxy - def test_four(self, twooperationgroup_endpoint): + def test_group1_four(self, twooperationgroup_endpoint): client = self.create_client(endpoint=twooperationgroup_endpoint) response = client.group1.four() diff --git a/packages/typespec-python/test/azure/generated/client-structure-twooperationgroup/generated_tests/test_two_operation_group_group1_operations_async.py b/packages/typespec-python/test/azure/generated/client-structure-twooperationgroup/generated_tests/test_two_operation_group_group1_operations_async.py index b24805f06c5..539bfde4da6 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-twooperationgroup/generated_tests/test_two_operation_group_group1_operations_async.py +++ b/packages/typespec-python/test/azure/generated/client-structure-twooperationgroup/generated_tests/test_two_operation_group_group1_operations_async.py @@ -15,7 +15,7 @@ class TestTwoOperationGroupGroup1OperationsAsync(TwoOperationGroupClientTestBaseAsync): @TwoOperationGroupPreparer() @recorded_by_proxy_async - async def test_one(self, twooperationgroup_endpoint): + async def test_group1_one(self, twooperationgroup_endpoint): client = self.create_async_client(endpoint=twooperationgroup_endpoint) response = await client.group1.one() @@ -24,7 +24,7 @@ async def test_one(self, twooperationgroup_endpoint): @TwoOperationGroupPreparer() @recorded_by_proxy_async - async def test_three(self, twooperationgroup_endpoint): + async def test_group1_three(self, twooperationgroup_endpoint): client = self.create_async_client(endpoint=twooperationgroup_endpoint) response = await client.group1.three() @@ -33,7 +33,7 @@ async def test_three(self, twooperationgroup_endpoint): @TwoOperationGroupPreparer() @recorded_by_proxy_async - async def test_four(self, twooperationgroup_endpoint): + async def test_group1_four(self, twooperationgroup_endpoint): client = self.create_async_client(endpoint=twooperationgroup_endpoint) response = await client.group1.four() diff --git a/packages/typespec-python/test/azure/generated/client-structure-twooperationgroup/generated_tests/test_two_operation_group_group2_operations.py b/packages/typespec-python/test/azure/generated/client-structure-twooperationgroup/generated_tests/test_two_operation_group_group2_operations.py index 1090e80730b..0e4194269bb 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-twooperationgroup/generated_tests/test_two_operation_group_group2_operations.py +++ b/packages/typespec-python/test/azure/generated/client-structure-twooperationgroup/generated_tests/test_two_operation_group_group2_operations.py @@ -14,7 +14,7 @@ class TestTwoOperationGroupGroup2Operations(TwoOperationGroupClientTestBase): @TwoOperationGroupPreparer() @recorded_by_proxy - def test_two(self, twooperationgroup_endpoint): + def test_group2_two(self, twooperationgroup_endpoint): client = self.create_client(endpoint=twooperationgroup_endpoint) response = client.group2.two() @@ -23,7 +23,7 @@ def test_two(self, twooperationgroup_endpoint): @TwoOperationGroupPreparer() @recorded_by_proxy - def test_five(self, twooperationgroup_endpoint): + def test_group2_five(self, twooperationgroup_endpoint): client = self.create_client(endpoint=twooperationgroup_endpoint) response = client.group2.five() @@ -32,7 +32,7 @@ def test_five(self, twooperationgroup_endpoint): @TwoOperationGroupPreparer() @recorded_by_proxy - def test_six(self, twooperationgroup_endpoint): + def test_group2_six(self, twooperationgroup_endpoint): client = self.create_client(endpoint=twooperationgroup_endpoint) response = client.group2.six() diff --git a/packages/typespec-python/test/azure/generated/client-structure-twooperationgroup/generated_tests/test_two_operation_group_group2_operations_async.py b/packages/typespec-python/test/azure/generated/client-structure-twooperationgroup/generated_tests/test_two_operation_group_group2_operations_async.py index 2cc4a7f71f6..2097a90a553 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-twooperationgroup/generated_tests/test_two_operation_group_group2_operations_async.py +++ b/packages/typespec-python/test/azure/generated/client-structure-twooperationgroup/generated_tests/test_two_operation_group_group2_operations_async.py @@ -15,7 +15,7 @@ class TestTwoOperationGroupGroup2OperationsAsync(TwoOperationGroupClientTestBaseAsync): @TwoOperationGroupPreparer() @recorded_by_proxy_async - async def test_two(self, twooperationgroup_endpoint): + async def test_group2_two(self, twooperationgroup_endpoint): client = self.create_async_client(endpoint=twooperationgroup_endpoint) response = await client.group2.two() @@ -24,7 +24,7 @@ async def test_two(self, twooperationgroup_endpoint): @TwoOperationGroupPreparer() @recorded_by_proxy_async - async def test_five(self, twooperationgroup_endpoint): + async def test_group2_five(self, twooperationgroup_endpoint): client = self.create_async_client(endpoint=twooperationgroup_endpoint) response = await client.group2.five() @@ -33,7 +33,7 @@ async def test_five(self, twooperationgroup_endpoint): @TwoOperationGroupPreparer() @recorded_by_proxy_async - async def test_six(self, twooperationgroup_endpoint): + async def test_group2_six(self, twooperationgroup_endpoint): client = self.create_async_client(endpoint=twooperationgroup_endpoint) response = await client.group2.six() diff --git a/packages/typespec-python/test/azure/generated/encode-bytes/generated_tests/test_bytes_header_operations.py b/packages/typespec-python/test/azure/generated/encode-bytes/generated_tests/test_bytes_header_operations.py index fe054e41b3a..616fd7ecfa3 100644 --- a/packages/typespec-python/test/azure/generated/encode-bytes/generated_tests/test_bytes_header_operations.py +++ b/packages/typespec-python/test/azure/generated/encode-bytes/generated_tests/test_bytes_header_operations.py @@ -14,7 +14,7 @@ class TestBytesHeaderOperations(BytesClientTestBase): @BytesPreparer() @recorded_by_proxy - def test_default(self, bytes_endpoint): + def test_header_default(self, bytes_endpoint): client = self.create_client(endpoint=bytes_endpoint) response = client.header.default( value=bytes("bytes", encoding="utf-8"), @@ -25,7 +25,7 @@ def test_default(self, bytes_endpoint): @BytesPreparer() @recorded_by_proxy - def test_base64(self, bytes_endpoint): + def test_header_base64(self, bytes_endpoint): client = self.create_client(endpoint=bytes_endpoint) response = client.header.base64( value=bytes("bytes", encoding="utf-8"), @@ -36,7 +36,7 @@ def test_base64(self, bytes_endpoint): @BytesPreparer() @recorded_by_proxy - def test_base64_url(self, bytes_endpoint): + def test_header_base64_url(self, bytes_endpoint): client = self.create_client(endpoint=bytes_endpoint) response = client.header.base64_url( value=bytes("bytes", encoding="utf-8"), @@ -47,7 +47,7 @@ def test_base64_url(self, bytes_endpoint): @BytesPreparer() @recorded_by_proxy - def test_base64_url_array(self, bytes_endpoint): + def test_header_base64_url_array(self, bytes_endpoint): client = self.create_client(endpoint=bytes_endpoint) response = client.header.base64_url_array( value=[bytes("bytes", encoding="utf-8")], diff --git a/packages/typespec-python/test/azure/generated/encode-bytes/generated_tests/test_bytes_header_operations_async.py b/packages/typespec-python/test/azure/generated/encode-bytes/generated_tests/test_bytes_header_operations_async.py index 057695414ef..8a957f4dbfc 100644 --- a/packages/typespec-python/test/azure/generated/encode-bytes/generated_tests/test_bytes_header_operations_async.py +++ b/packages/typespec-python/test/azure/generated/encode-bytes/generated_tests/test_bytes_header_operations_async.py @@ -15,7 +15,7 @@ class TestBytesHeaderOperationsAsync(BytesClientTestBaseAsync): @BytesPreparer() @recorded_by_proxy_async - async def test_default(self, bytes_endpoint): + async def test_header_default(self, bytes_endpoint): client = self.create_async_client(endpoint=bytes_endpoint) response = await client.header.default( value=bytes("bytes", encoding="utf-8"), @@ -26,7 +26,7 @@ async def test_default(self, bytes_endpoint): @BytesPreparer() @recorded_by_proxy_async - async def test_base64(self, bytes_endpoint): + async def test_header_base64(self, bytes_endpoint): client = self.create_async_client(endpoint=bytes_endpoint) response = await client.header.base64( value=bytes("bytes", encoding="utf-8"), @@ -37,7 +37,7 @@ async def test_base64(self, bytes_endpoint): @BytesPreparer() @recorded_by_proxy_async - async def test_base64_url(self, bytes_endpoint): + async def test_header_base64_url(self, bytes_endpoint): client = self.create_async_client(endpoint=bytes_endpoint) response = await client.header.base64_url( value=bytes("bytes", encoding="utf-8"), @@ -48,7 +48,7 @@ async def test_base64_url(self, bytes_endpoint): @BytesPreparer() @recorded_by_proxy_async - async def test_base64_url_array(self, bytes_endpoint): + async def test_header_base64_url_array(self, bytes_endpoint): client = self.create_async_client(endpoint=bytes_endpoint) response = await client.header.base64_url_array( value=[bytes("bytes", encoding="utf-8")], diff --git a/packages/typespec-python/test/azure/generated/encode-bytes/generated_tests/test_bytes_property_operations.py b/packages/typespec-python/test/azure/generated/encode-bytes/generated_tests/test_bytes_property_operations.py index eb8ec53148a..a797ba0131d 100644 --- a/packages/typespec-python/test/azure/generated/encode-bytes/generated_tests/test_bytes_property_operations.py +++ b/packages/typespec-python/test/azure/generated/encode-bytes/generated_tests/test_bytes_property_operations.py @@ -14,7 +14,7 @@ class TestBytesPropertyOperations(BytesClientTestBase): @BytesPreparer() @recorded_by_proxy - def test_default(self, bytes_endpoint): + def test_property_default(self, bytes_endpoint): client = self.create_client(endpoint=bytes_endpoint) response = client.property.default( body={"value": bytes("bytes", encoding="utf-8")}, @@ -25,7 +25,7 @@ def test_default(self, bytes_endpoint): @BytesPreparer() @recorded_by_proxy - def test_base64(self, bytes_endpoint): + def test_property_base64(self, bytes_endpoint): client = self.create_client(endpoint=bytes_endpoint) response = client.property.base64( body={"value": bytes("bytes", encoding="utf-8")}, @@ -36,7 +36,7 @@ def test_base64(self, bytes_endpoint): @BytesPreparer() @recorded_by_proxy - def test_base64_url(self, bytes_endpoint): + def test_property_base64_url(self, bytes_endpoint): client = self.create_client(endpoint=bytes_endpoint) response = client.property.base64_url( body={"value": bytes("bytes", encoding="utf-8")}, @@ -47,7 +47,7 @@ def test_base64_url(self, bytes_endpoint): @BytesPreparer() @recorded_by_proxy - def test_base64_url_array(self, bytes_endpoint): + def test_property_base64_url_array(self, bytes_endpoint): client = self.create_client(endpoint=bytes_endpoint) response = client.property.base64_url_array( body={"value": [bytes("bytes", encoding="utf-8")]}, diff --git a/packages/typespec-python/test/azure/generated/encode-bytes/generated_tests/test_bytes_property_operations_async.py b/packages/typespec-python/test/azure/generated/encode-bytes/generated_tests/test_bytes_property_operations_async.py index 35b8cf89089..fd1c0f97a12 100644 --- a/packages/typespec-python/test/azure/generated/encode-bytes/generated_tests/test_bytes_property_operations_async.py +++ b/packages/typespec-python/test/azure/generated/encode-bytes/generated_tests/test_bytes_property_operations_async.py @@ -15,7 +15,7 @@ class TestBytesPropertyOperationsAsync(BytesClientTestBaseAsync): @BytesPreparer() @recorded_by_proxy_async - async def test_default(self, bytes_endpoint): + async def test_property_default(self, bytes_endpoint): client = self.create_async_client(endpoint=bytes_endpoint) response = await client.property.default( body={"value": bytes("bytes", encoding="utf-8")}, @@ -26,7 +26,7 @@ async def test_default(self, bytes_endpoint): @BytesPreparer() @recorded_by_proxy_async - async def test_base64(self, bytes_endpoint): + async def test_property_base64(self, bytes_endpoint): client = self.create_async_client(endpoint=bytes_endpoint) response = await client.property.base64( body={"value": bytes("bytes", encoding="utf-8")}, @@ -37,7 +37,7 @@ async def test_base64(self, bytes_endpoint): @BytesPreparer() @recorded_by_proxy_async - async def test_base64_url(self, bytes_endpoint): + async def test_property_base64_url(self, bytes_endpoint): client = self.create_async_client(endpoint=bytes_endpoint) response = await client.property.base64_url( body={"value": bytes("bytes", encoding="utf-8")}, @@ -48,7 +48,7 @@ async def test_base64_url(self, bytes_endpoint): @BytesPreparer() @recorded_by_proxy_async - async def test_base64_url_array(self, bytes_endpoint): + async def test_property_base64_url_array(self, bytes_endpoint): client = self.create_async_client(endpoint=bytes_endpoint) response = await client.property.base64_url_array( body={"value": [bytes("bytes", encoding="utf-8")]}, diff --git a/packages/typespec-python/test/azure/generated/encode-bytes/generated_tests/test_bytes_query_operations.py b/packages/typespec-python/test/azure/generated/encode-bytes/generated_tests/test_bytes_query_operations.py index c0e911d2239..49f4b3ff3db 100644 --- a/packages/typespec-python/test/azure/generated/encode-bytes/generated_tests/test_bytes_query_operations.py +++ b/packages/typespec-python/test/azure/generated/encode-bytes/generated_tests/test_bytes_query_operations.py @@ -14,7 +14,7 @@ class TestBytesQueryOperations(BytesClientTestBase): @BytesPreparer() @recorded_by_proxy - def test_default(self, bytes_endpoint): + def test_query_default(self, bytes_endpoint): client = self.create_client(endpoint=bytes_endpoint) response = client.query.default( value=bytes("bytes", encoding="utf-8"), @@ -25,7 +25,7 @@ def test_default(self, bytes_endpoint): @BytesPreparer() @recorded_by_proxy - def test_base64(self, bytes_endpoint): + def test_query_base64(self, bytes_endpoint): client = self.create_client(endpoint=bytes_endpoint) response = client.query.base64( value=bytes("bytes", encoding="utf-8"), @@ -36,7 +36,7 @@ def test_base64(self, bytes_endpoint): @BytesPreparer() @recorded_by_proxy - def test_base64_url(self, bytes_endpoint): + def test_query_base64_url(self, bytes_endpoint): client = self.create_client(endpoint=bytes_endpoint) response = client.query.base64_url( value=bytes("bytes", encoding="utf-8"), @@ -47,7 +47,7 @@ def test_base64_url(self, bytes_endpoint): @BytesPreparer() @recorded_by_proxy - def test_base64_url_array(self, bytes_endpoint): + def test_query_base64_url_array(self, bytes_endpoint): client = self.create_client(endpoint=bytes_endpoint) response = client.query.base64_url_array( value=[bytes("bytes", encoding="utf-8")], diff --git a/packages/typespec-python/test/azure/generated/encode-bytes/generated_tests/test_bytes_query_operations_async.py b/packages/typespec-python/test/azure/generated/encode-bytes/generated_tests/test_bytes_query_operations_async.py index fee2ebbd408..b108afe5b12 100644 --- a/packages/typespec-python/test/azure/generated/encode-bytes/generated_tests/test_bytes_query_operations_async.py +++ b/packages/typespec-python/test/azure/generated/encode-bytes/generated_tests/test_bytes_query_operations_async.py @@ -15,7 +15,7 @@ class TestBytesQueryOperationsAsync(BytesClientTestBaseAsync): @BytesPreparer() @recorded_by_proxy_async - async def test_default(self, bytes_endpoint): + async def test_query_default(self, bytes_endpoint): client = self.create_async_client(endpoint=bytes_endpoint) response = await client.query.default( value=bytes("bytes", encoding="utf-8"), @@ -26,7 +26,7 @@ async def test_default(self, bytes_endpoint): @BytesPreparer() @recorded_by_proxy_async - async def test_base64(self, bytes_endpoint): + async def test_query_base64(self, bytes_endpoint): client = self.create_async_client(endpoint=bytes_endpoint) response = await client.query.base64( value=bytes("bytes", encoding="utf-8"), @@ -37,7 +37,7 @@ async def test_base64(self, bytes_endpoint): @BytesPreparer() @recorded_by_proxy_async - async def test_base64_url(self, bytes_endpoint): + async def test_query_base64_url(self, bytes_endpoint): client = self.create_async_client(endpoint=bytes_endpoint) response = await client.query.base64_url( value=bytes("bytes", encoding="utf-8"), @@ -48,7 +48,7 @@ async def test_base64_url(self, bytes_endpoint): @BytesPreparer() @recorded_by_proxy_async - async def test_base64_url_array(self, bytes_endpoint): + async def test_query_base64_url_array(self, bytes_endpoint): client = self.create_async_client(endpoint=bytes_endpoint) response = await client.query.base64_url_array( value=[bytes("bytes", encoding="utf-8")], diff --git a/packages/typespec-python/test/azure/generated/encode-bytes/generated_tests/test_bytes_request_body_operations.py b/packages/typespec-python/test/azure/generated/encode-bytes/generated_tests/test_bytes_request_body_operations.py index f455b29d1b8..1d083b7c7b3 100644 --- a/packages/typespec-python/test/azure/generated/encode-bytes/generated_tests/test_bytes_request_body_operations.py +++ b/packages/typespec-python/test/azure/generated/encode-bytes/generated_tests/test_bytes_request_body_operations.py @@ -14,7 +14,7 @@ class TestBytesRequestBodyOperations(BytesClientTestBase): @BytesPreparer() @recorded_by_proxy - def test_default(self, bytes_endpoint): + def test_request_body_default(self, bytes_endpoint): client = self.create_client(endpoint=bytes_endpoint) response = client.request_body.default( value=bytes("bytes", encoding="utf-8"), @@ -26,7 +26,7 @@ def test_default(self, bytes_endpoint): @BytesPreparer() @recorded_by_proxy - def test_octet_stream(self, bytes_endpoint): + def test_request_body_octet_stream(self, bytes_endpoint): client = self.create_client(endpoint=bytes_endpoint) response = client.request_body.octet_stream( value=bytes("bytes", encoding="utf-8"), @@ -38,7 +38,7 @@ def test_octet_stream(self, bytes_endpoint): @BytesPreparer() @recorded_by_proxy - def test_custom_content_type(self, bytes_endpoint): + def test_request_body_custom_content_type(self, bytes_endpoint): client = self.create_client(endpoint=bytes_endpoint) response = client.request_body.custom_content_type( value=bytes("bytes", encoding="utf-8"), @@ -50,7 +50,7 @@ def test_custom_content_type(self, bytes_endpoint): @BytesPreparer() @recorded_by_proxy - def test_base64(self, bytes_endpoint): + def test_request_body_base64(self, bytes_endpoint): client = self.create_client(endpoint=bytes_endpoint) response = client.request_body.base64( value=bytes("bytes", encoding="utf-8"), @@ -62,7 +62,7 @@ def test_base64(self, bytes_endpoint): @BytesPreparer() @recorded_by_proxy - def test_base64_url(self, bytes_endpoint): + def test_request_body_base64_url(self, bytes_endpoint): client = self.create_client(endpoint=bytes_endpoint) response = client.request_body.base64_url( value=bytes("bytes", encoding="utf-8"), diff --git a/packages/typespec-python/test/azure/generated/encode-bytes/generated_tests/test_bytes_request_body_operations_async.py b/packages/typespec-python/test/azure/generated/encode-bytes/generated_tests/test_bytes_request_body_operations_async.py index b85130c7a18..a02a0e071e2 100644 --- a/packages/typespec-python/test/azure/generated/encode-bytes/generated_tests/test_bytes_request_body_operations_async.py +++ b/packages/typespec-python/test/azure/generated/encode-bytes/generated_tests/test_bytes_request_body_operations_async.py @@ -15,7 +15,7 @@ class TestBytesRequestBodyOperationsAsync(BytesClientTestBaseAsync): @BytesPreparer() @recorded_by_proxy_async - async def test_default(self, bytes_endpoint): + async def test_request_body_default(self, bytes_endpoint): client = self.create_async_client(endpoint=bytes_endpoint) response = await client.request_body.default( value=bytes("bytes", encoding="utf-8"), @@ -27,7 +27,7 @@ async def test_default(self, bytes_endpoint): @BytesPreparer() @recorded_by_proxy_async - async def test_octet_stream(self, bytes_endpoint): + async def test_request_body_octet_stream(self, bytes_endpoint): client = self.create_async_client(endpoint=bytes_endpoint) response = await client.request_body.octet_stream( value=bytes("bytes", encoding="utf-8"), @@ -39,7 +39,7 @@ async def test_octet_stream(self, bytes_endpoint): @BytesPreparer() @recorded_by_proxy_async - async def test_custom_content_type(self, bytes_endpoint): + async def test_request_body_custom_content_type(self, bytes_endpoint): client = self.create_async_client(endpoint=bytes_endpoint) response = await client.request_body.custom_content_type( value=bytes("bytes", encoding="utf-8"), @@ -51,7 +51,7 @@ async def test_custom_content_type(self, bytes_endpoint): @BytesPreparer() @recorded_by_proxy_async - async def test_base64(self, bytes_endpoint): + async def test_request_body_base64(self, bytes_endpoint): client = self.create_async_client(endpoint=bytes_endpoint) response = await client.request_body.base64( value=bytes("bytes", encoding="utf-8"), @@ -63,7 +63,7 @@ async def test_base64(self, bytes_endpoint): @BytesPreparer() @recorded_by_proxy_async - async def test_base64_url(self, bytes_endpoint): + async def test_request_body_base64_url(self, bytes_endpoint): client = self.create_async_client(endpoint=bytes_endpoint) response = await client.request_body.base64_url( value=bytes("bytes", encoding="utf-8"), diff --git a/packages/typespec-python/test/azure/generated/encode-bytes/generated_tests/test_bytes_response_body_operations.py b/packages/typespec-python/test/azure/generated/encode-bytes/generated_tests/test_bytes_response_body_operations.py index 303c039b383..1bb3aafaef9 100644 --- a/packages/typespec-python/test/azure/generated/encode-bytes/generated_tests/test_bytes_response_body_operations.py +++ b/packages/typespec-python/test/azure/generated/encode-bytes/generated_tests/test_bytes_response_body_operations.py @@ -14,7 +14,7 @@ class TestBytesResponseBodyOperations(BytesClientTestBase): @BytesPreparer() @recorded_by_proxy - def test_default(self, bytes_endpoint): + def test_response_body_default(self, bytes_endpoint): client = self.create_client(endpoint=bytes_endpoint) response = client.response_body.default() @@ -23,7 +23,7 @@ def test_default(self, bytes_endpoint): @BytesPreparer() @recorded_by_proxy - def test_octet_stream(self, bytes_endpoint): + def test_response_body_octet_stream(self, bytes_endpoint): client = self.create_client(endpoint=bytes_endpoint) response = client.response_body.octet_stream() @@ -32,7 +32,7 @@ def test_octet_stream(self, bytes_endpoint): @BytesPreparer() @recorded_by_proxy - def test_custom_content_type(self, bytes_endpoint): + def test_response_body_custom_content_type(self, bytes_endpoint): client = self.create_client(endpoint=bytes_endpoint) response = client.response_body.custom_content_type() @@ -41,7 +41,7 @@ def test_custom_content_type(self, bytes_endpoint): @BytesPreparer() @recorded_by_proxy - def test_base64(self, bytes_endpoint): + def test_response_body_base64(self, bytes_endpoint): client = self.create_client(endpoint=bytes_endpoint) response = client.response_body.base64() @@ -50,7 +50,7 @@ def test_base64(self, bytes_endpoint): @BytesPreparer() @recorded_by_proxy - def test_base64_url(self, bytes_endpoint): + def test_response_body_base64_url(self, bytes_endpoint): client = self.create_client(endpoint=bytes_endpoint) response = client.response_body.base64_url() diff --git a/packages/typespec-python/test/azure/generated/encode-bytes/generated_tests/test_bytes_response_body_operations_async.py b/packages/typespec-python/test/azure/generated/encode-bytes/generated_tests/test_bytes_response_body_operations_async.py index 13b7b8ddeda..8e702b41e39 100644 --- a/packages/typespec-python/test/azure/generated/encode-bytes/generated_tests/test_bytes_response_body_operations_async.py +++ b/packages/typespec-python/test/azure/generated/encode-bytes/generated_tests/test_bytes_response_body_operations_async.py @@ -15,7 +15,7 @@ class TestBytesResponseBodyOperationsAsync(BytesClientTestBaseAsync): @BytesPreparer() @recorded_by_proxy_async - async def test_default(self, bytes_endpoint): + async def test_response_body_default(self, bytes_endpoint): client = self.create_async_client(endpoint=bytes_endpoint) response = await client.response_body.default() @@ -24,7 +24,7 @@ async def test_default(self, bytes_endpoint): @BytesPreparer() @recorded_by_proxy_async - async def test_octet_stream(self, bytes_endpoint): + async def test_response_body_octet_stream(self, bytes_endpoint): client = self.create_async_client(endpoint=bytes_endpoint) response = await client.response_body.octet_stream() @@ -33,7 +33,7 @@ async def test_octet_stream(self, bytes_endpoint): @BytesPreparer() @recorded_by_proxy_async - async def test_custom_content_type(self, bytes_endpoint): + async def test_response_body_custom_content_type(self, bytes_endpoint): client = self.create_async_client(endpoint=bytes_endpoint) response = await client.response_body.custom_content_type() @@ -42,7 +42,7 @@ async def test_custom_content_type(self, bytes_endpoint): @BytesPreparer() @recorded_by_proxy_async - async def test_base64(self, bytes_endpoint): + async def test_response_body_base64(self, bytes_endpoint): client = self.create_async_client(endpoint=bytes_endpoint) response = await client.response_body.base64() @@ -51,7 +51,7 @@ async def test_base64(self, bytes_endpoint): @BytesPreparer() @recorded_by_proxy_async - async def test_base64_url(self, bytes_endpoint): + async def test_response_body_base64_url(self, bytes_endpoint): client = self.create_async_client(endpoint=bytes_endpoint) response = await client.response_body.base64_url() diff --git a/packages/typespec-python/test/azure/generated/encode-datetime/generated_tests/test_datetime_header_operations.py b/packages/typespec-python/test/azure/generated/encode-datetime/generated_tests/test_datetime_header_operations.py index 1a6943d8d71..db1045ed06e 100644 --- a/packages/typespec-python/test/azure/generated/encode-datetime/generated_tests/test_datetime_header_operations.py +++ b/packages/typespec-python/test/azure/generated/encode-datetime/generated_tests/test_datetime_header_operations.py @@ -14,7 +14,7 @@ class TestDatetimeHeaderOperations(DatetimeClientTestBase): @DatetimePreparer() @recorded_by_proxy - def test_default(self, datetime_endpoint): + def test_header_default(self, datetime_endpoint): client = self.create_client(endpoint=datetime_endpoint) response = client.header.default( value="2020-02-20 00:00:00", @@ -25,7 +25,7 @@ def test_default(self, datetime_endpoint): @DatetimePreparer() @recorded_by_proxy - def test_rfc3339(self, datetime_endpoint): + def test_header_rfc3339(self, datetime_endpoint): client = self.create_client(endpoint=datetime_endpoint) response = client.header.rfc3339( value="2020-02-20 00:00:00", @@ -36,7 +36,7 @@ def test_rfc3339(self, datetime_endpoint): @DatetimePreparer() @recorded_by_proxy - def test_rfc7231(self, datetime_endpoint): + def test_header_rfc7231(self, datetime_endpoint): client = self.create_client(endpoint=datetime_endpoint) response = client.header.rfc7231( value="2020-02-20 00:00:00", @@ -47,7 +47,7 @@ def test_rfc7231(self, datetime_endpoint): @DatetimePreparer() @recorded_by_proxy - def test_unix_timestamp(self, datetime_endpoint): + def test_header_unix_timestamp(self, datetime_endpoint): client = self.create_client(endpoint=datetime_endpoint) response = client.header.unix_timestamp( value="2020-02-20 00:00:00", @@ -58,7 +58,7 @@ def test_unix_timestamp(self, datetime_endpoint): @DatetimePreparer() @recorded_by_proxy - def test_unix_timestamp_array(self, datetime_endpoint): + def test_header_unix_timestamp_array(self, datetime_endpoint): client = self.create_client(endpoint=datetime_endpoint) response = client.header.unix_timestamp_array( value=["2020-02-20 00:00:00"], diff --git a/packages/typespec-python/test/azure/generated/encode-datetime/generated_tests/test_datetime_header_operations_async.py b/packages/typespec-python/test/azure/generated/encode-datetime/generated_tests/test_datetime_header_operations_async.py index 76a08bbb509..bdf46c102fb 100644 --- a/packages/typespec-python/test/azure/generated/encode-datetime/generated_tests/test_datetime_header_operations_async.py +++ b/packages/typespec-python/test/azure/generated/encode-datetime/generated_tests/test_datetime_header_operations_async.py @@ -15,7 +15,7 @@ class TestDatetimeHeaderOperationsAsync(DatetimeClientTestBaseAsync): @DatetimePreparer() @recorded_by_proxy_async - async def test_default(self, datetime_endpoint): + async def test_header_default(self, datetime_endpoint): client = self.create_async_client(endpoint=datetime_endpoint) response = await client.header.default( value="2020-02-20 00:00:00", @@ -26,7 +26,7 @@ async def test_default(self, datetime_endpoint): @DatetimePreparer() @recorded_by_proxy_async - async def test_rfc3339(self, datetime_endpoint): + async def test_header_rfc3339(self, datetime_endpoint): client = self.create_async_client(endpoint=datetime_endpoint) response = await client.header.rfc3339( value="2020-02-20 00:00:00", @@ -37,7 +37,7 @@ async def test_rfc3339(self, datetime_endpoint): @DatetimePreparer() @recorded_by_proxy_async - async def test_rfc7231(self, datetime_endpoint): + async def test_header_rfc7231(self, datetime_endpoint): client = self.create_async_client(endpoint=datetime_endpoint) response = await client.header.rfc7231( value="2020-02-20 00:00:00", @@ -48,7 +48,7 @@ async def test_rfc7231(self, datetime_endpoint): @DatetimePreparer() @recorded_by_proxy_async - async def test_unix_timestamp(self, datetime_endpoint): + async def test_header_unix_timestamp(self, datetime_endpoint): client = self.create_async_client(endpoint=datetime_endpoint) response = await client.header.unix_timestamp( value="2020-02-20 00:00:00", @@ -59,7 +59,7 @@ async def test_unix_timestamp(self, datetime_endpoint): @DatetimePreparer() @recorded_by_proxy_async - async def test_unix_timestamp_array(self, datetime_endpoint): + async def test_header_unix_timestamp_array(self, datetime_endpoint): client = self.create_async_client(endpoint=datetime_endpoint) response = await client.header.unix_timestamp_array( value=["2020-02-20 00:00:00"], diff --git a/packages/typespec-python/test/azure/generated/encode-datetime/generated_tests/test_datetime_property_operations.py b/packages/typespec-python/test/azure/generated/encode-datetime/generated_tests/test_datetime_property_operations.py index e1551a70bd3..53447582c24 100644 --- a/packages/typespec-python/test/azure/generated/encode-datetime/generated_tests/test_datetime_property_operations.py +++ b/packages/typespec-python/test/azure/generated/encode-datetime/generated_tests/test_datetime_property_operations.py @@ -14,7 +14,7 @@ class TestDatetimePropertyOperations(DatetimeClientTestBase): @DatetimePreparer() @recorded_by_proxy - def test_default(self, datetime_endpoint): + def test_property_default(self, datetime_endpoint): client = self.create_client(endpoint=datetime_endpoint) response = client.property.default( body={"value": "2020-02-20 00:00:00"}, @@ -25,7 +25,7 @@ def test_default(self, datetime_endpoint): @DatetimePreparer() @recorded_by_proxy - def test_rfc3339(self, datetime_endpoint): + def test_property_rfc3339(self, datetime_endpoint): client = self.create_client(endpoint=datetime_endpoint) response = client.property.rfc3339( body={"value": "2020-02-20 00:00:00"}, @@ -36,7 +36,7 @@ def test_rfc3339(self, datetime_endpoint): @DatetimePreparer() @recorded_by_proxy - def test_rfc7231(self, datetime_endpoint): + def test_property_rfc7231(self, datetime_endpoint): client = self.create_client(endpoint=datetime_endpoint) response = client.property.rfc7231( body={"value": "2020-02-20 00:00:00"}, @@ -47,7 +47,7 @@ def test_rfc7231(self, datetime_endpoint): @DatetimePreparer() @recorded_by_proxy - def test_unix_timestamp(self, datetime_endpoint): + def test_property_unix_timestamp(self, datetime_endpoint): client = self.create_client(endpoint=datetime_endpoint) response = client.property.unix_timestamp( body={"value": "2020-02-20 00:00:00"}, @@ -58,7 +58,7 @@ def test_unix_timestamp(self, datetime_endpoint): @DatetimePreparer() @recorded_by_proxy - def test_unix_timestamp_array(self, datetime_endpoint): + def test_property_unix_timestamp_array(self, datetime_endpoint): client = self.create_client(endpoint=datetime_endpoint) response = client.property.unix_timestamp_array( body={"value": ["2020-02-20 00:00:00"]}, diff --git a/packages/typespec-python/test/azure/generated/encode-datetime/generated_tests/test_datetime_property_operations_async.py b/packages/typespec-python/test/azure/generated/encode-datetime/generated_tests/test_datetime_property_operations_async.py index 95a5cc9a3a9..c7062cd1d6f 100644 --- a/packages/typespec-python/test/azure/generated/encode-datetime/generated_tests/test_datetime_property_operations_async.py +++ b/packages/typespec-python/test/azure/generated/encode-datetime/generated_tests/test_datetime_property_operations_async.py @@ -15,7 +15,7 @@ class TestDatetimePropertyOperationsAsync(DatetimeClientTestBaseAsync): @DatetimePreparer() @recorded_by_proxy_async - async def test_default(self, datetime_endpoint): + async def test_property_default(self, datetime_endpoint): client = self.create_async_client(endpoint=datetime_endpoint) response = await client.property.default( body={"value": "2020-02-20 00:00:00"}, @@ -26,7 +26,7 @@ async def test_default(self, datetime_endpoint): @DatetimePreparer() @recorded_by_proxy_async - async def test_rfc3339(self, datetime_endpoint): + async def test_property_rfc3339(self, datetime_endpoint): client = self.create_async_client(endpoint=datetime_endpoint) response = await client.property.rfc3339( body={"value": "2020-02-20 00:00:00"}, @@ -37,7 +37,7 @@ async def test_rfc3339(self, datetime_endpoint): @DatetimePreparer() @recorded_by_proxy_async - async def test_rfc7231(self, datetime_endpoint): + async def test_property_rfc7231(self, datetime_endpoint): client = self.create_async_client(endpoint=datetime_endpoint) response = await client.property.rfc7231( body={"value": "2020-02-20 00:00:00"}, @@ -48,7 +48,7 @@ async def test_rfc7231(self, datetime_endpoint): @DatetimePreparer() @recorded_by_proxy_async - async def test_unix_timestamp(self, datetime_endpoint): + async def test_property_unix_timestamp(self, datetime_endpoint): client = self.create_async_client(endpoint=datetime_endpoint) response = await client.property.unix_timestamp( body={"value": "2020-02-20 00:00:00"}, @@ -59,7 +59,7 @@ async def test_unix_timestamp(self, datetime_endpoint): @DatetimePreparer() @recorded_by_proxy_async - async def test_unix_timestamp_array(self, datetime_endpoint): + async def test_property_unix_timestamp_array(self, datetime_endpoint): client = self.create_async_client(endpoint=datetime_endpoint) response = await client.property.unix_timestamp_array( body={"value": ["2020-02-20 00:00:00"]}, diff --git a/packages/typespec-python/test/azure/generated/encode-datetime/generated_tests/test_datetime_query_operations.py b/packages/typespec-python/test/azure/generated/encode-datetime/generated_tests/test_datetime_query_operations.py index 9c93ef3df47..43419883b18 100644 --- a/packages/typespec-python/test/azure/generated/encode-datetime/generated_tests/test_datetime_query_operations.py +++ b/packages/typespec-python/test/azure/generated/encode-datetime/generated_tests/test_datetime_query_operations.py @@ -14,7 +14,7 @@ class TestDatetimeQueryOperations(DatetimeClientTestBase): @DatetimePreparer() @recorded_by_proxy - def test_default(self, datetime_endpoint): + def test_query_default(self, datetime_endpoint): client = self.create_client(endpoint=datetime_endpoint) response = client.query.default( value="2020-02-20 00:00:00", @@ -25,7 +25,7 @@ def test_default(self, datetime_endpoint): @DatetimePreparer() @recorded_by_proxy - def test_rfc3339(self, datetime_endpoint): + def test_query_rfc3339(self, datetime_endpoint): client = self.create_client(endpoint=datetime_endpoint) response = client.query.rfc3339( value="2020-02-20 00:00:00", @@ -36,7 +36,7 @@ def test_rfc3339(self, datetime_endpoint): @DatetimePreparer() @recorded_by_proxy - def test_rfc7231(self, datetime_endpoint): + def test_query_rfc7231(self, datetime_endpoint): client = self.create_client(endpoint=datetime_endpoint) response = client.query.rfc7231( value="2020-02-20 00:00:00", @@ -47,7 +47,7 @@ def test_rfc7231(self, datetime_endpoint): @DatetimePreparer() @recorded_by_proxy - def test_unix_timestamp(self, datetime_endpoint): + def test_query_unix_timestamp(self, datetime_endpoint): client = self.create_client(endpoint=datetime_endpoint) response = client.query.unix_timestamp( value="2020-02-20 00:00:00", @@ -58,7 +58,7 @@ def test_unix_timestamp(self, datetime_endpoint): @DatetimePreparer() @recorded_by_proxy - def test_unix_timestamp_array(self, datetime_endpoint): + def test_query_unix_timestamp_array(self, datetime_endpoint): client = self.create_client(endpoint=datetime_endpoint) response = client.query.unix_timestamp_array( value=["2020-02-20 00:00:00"], diff --git a/packages/typespec-python/test/azure/generated/encode-datetime/generated_tests/test_datetime_query_operations_async.py b/packages/typespec-python/test/azure/generated/encode-datetime/generated_tests/test_datetime_query_operations_async.py index 7c859eeb64b..d2ea13edbfd 100644 --- a/packages/typespec-python/test/azure/generated/encode-datetime/generated_tests/test_datetime_query_operations_async.py +++ b/packages/typespec-python/test/azure/generated/encode-datetime/generated_tests/test_datetime_query_operations_async.py @@ -15,7 +15,7 @@ class TestDatetimeQueryOperationsAsync(DatetimeClientTestBaseAsync): @DatetimePreparer() @recorded_by_proxy_async - async def test_default(self, datetime_endpoint): + async def test_query_default(self, datetime_endpoint): client = self.create_async_client(endpoint=datetime_endpoint) response = await client.query.default( value="2020-02-20 00:00:00", @@ -26,7 +26,7 @@ async def test_default(self, datetime_endpoint): @DatetimePreparer() @recorded_by_proxy_async - async def test_rfc3339(self, datetime_endpoint): + async def test_query_rfc3339(self, datetime_endpoint): client = self.create_async_client(endpoint=datetime_endpoint) response = await client.query.rfc3339( value="2020-02-20 00:00:00", @@ -37,7 +37,7 @@ async def test_rfc3339(self, datetime_endpoint): @DatetimePreparer() @recorded_by_proxy_async - async def test_rfc7231(self, datetime_endpoint): + async def test_query_rfc7231(self, datetime_endpoint): client = self.create_async_client(endpoint=datetime_endpoint) response = await client.query.rfc7231( value="2020-02-20 00:00:00", @@ -48,7 +48,7 @@ async def test_rfc7231(self, datetime_endpoint): @DatetimePreparer() @recorded_by_proxy_async - async def test_unix_timestamp(self, datetime_endpoint): + async def test_query_unix_timestamp(self, datetime_endpoint): client = self.create_async_client(endpoint=datetime_endpoint) response = await client.query.unix_timestamp( value="2020-02-20 00:00:00", @@ -59,7 +59,7 @@ async def test_unix_timestamp(self, datetime_endpoint): @DatetimePreparer() @recorded_by_proxy_async - async def test_unix_timestamp_array(self, datetime_endpoint): + async def test_query_unix_timestamp_array(self, datetime_endpoint): client = self.create_async_client(endpoint=datetime_endpoint) response = await client.query.unix_timestamp_array( value=["2020-02-20 00:00:00"], diff --git a/packages/typespec-python/test/azure/generated/encode-datetime/generated_tests/test_datetime_response_header_operations.py b/packages/typespec-python/test/azure/generated/encode-datetime/generated_tests/test_datetime_response_header_operations.py index 33c56c1e9d9..7facfe78744 100644 --- a/packages/typespec-python/test/azure/generated/encode-datetime/generated_tests/test_datetime_response_header_operations.py +++ b/packages/typespec-python/test/azure/generated/encode-datetime/generated_tests/test_datetime_response_header_operations.py @@ -14,7 +14,7 @@ class TestDatetimeResponseHeaderOperations(DatetimeClientTestBase): @DatetimePreparer() @recorded_by_proxy - def test_default(self, datetime_endpoint): + def test_response_header_default(self, datetime_endpoint): client = self.create_client(endpoint=datetime_endpoint) response = client.response_header.default() @@ -23,7 +23,7 @@ def test_default(self, datetime_endpoint): @DatetimePreparer() @recorded_by_proxy - def test_rfc3339(self, datetime_endpoint): + def test_response_header_rfc3339(self, datetime_endpoint): client = self.create_client(endpoint=datetime_endpoint) response = client.response_header.rfc3339() @@ -32,7 +32,7 @@ def test_rfc3339(self, datetime_endpoint): @DatetimePreparer() @recorded_by_proxy - def test_rfc7231(self, datetime_endpoint): + def test_response_header_rfc7231(self, datetime_endpoint): client = self.create_client(endpoint=datetime_endpoint) response = client.response_header.rfc7231() @@ -41,7 +41,7 @@ def test_rfc7231(self, datetime_endpoint): @DatetimePreparer() @recorded_by_proxy - def test_unix_timestamp(self, datetime_endpoint): + def test_response_header_unix_timestamp(self, datetime_endpoint): client = self.create_client(endpoint=datetime_endpoint) response = client.response_header.unix_timestamp() diff --git a/packages/typespec-python/test/azure/generated/encode-datetime/generated_tests/test_datetime_response_header_operations_async.py b/packages/typespec-python/test/azure/generated/encode-datetime/generated_tests/test_datetime_response_header_operations_async.py index 8c3bb7c9e1c..304b646609e 100644 --- a/packages/typespec-python/test/azure/generated/encode-datetime/generated_tests/test_datetime_response_header_operations_async.py +++ b/packages/typespec-python/test/azure/generated/encode-datetime/generated_tests/test_datetime_response_header_operations_async.py @@ -15,7 +15,7 @@ class TestDatetimeResponseHeaderOperationsAsync(DatetimeClientTestBaseAsync): @DatetimePreparer() @recorded_by_proxy_async - async def test_default(self, datetime_endpoint): + async def test_response_header_default(self, datetime_endpoint): client = self.create_async_client(endpoint=datetime_endpoint) response = await client.response_header.default() @@ -24,7 +24,7 @@ async def test_default(self, datetime_endpoint): @DatetimePreparer() @recorded_by_proxy_async - async def test_rfc3339(self, datetime_endpoint): + async def test_response_header_rfc3339(self, datetime_endpoint): client = self.create_async_client(endpoint=datetime_endpoint) response = await client.response_header.rfc3339() @@ -33,7 +33,7 @@ async def test_rfc3339(self, datetime_endpoint): @DatetimePreparer() @recorded_by_proxy_async - async def test_rfc7231(self, datetime_endpoint): + async def test_response_header_rfc7231(self, datetime_endpoint): client = self.create_async_client(endpoint=datetime_endpoint) response = await client.response_header.rfc7231() @@ -42,7 +42,7 @@ async def test_rfc7231(self, datetime_endpoint): @DatetimePreparer() @recorded_by_proxy_async - async def test_unix_timestamp(self, datetime_endpoint): + async def test_response_header_unix_timestamp(self, datetime_endpoint): client = self.create_async_client(endpoint=datetime_endpoint) response = await client.response_header.unix_timestamp() diff --git a/packages/typespec-python/test/azure/generated/encode-duration/generated_tests/test_duration_header_operations.py b/packages/typespec-python/test/azure/generated/encode-duration/generated_tests/test_duration_header_operations.py index dcdc9e96f7f..f3bf725bed1 100644 --- a/packages/typespec-python/test/azure/generated/encode-duration/generated_tests/test_duration_header_operations.py +++ b/packages/typespec-python/test/azure/generated/encode-duration/generated_tests/test_duration_header_operations.py @@ -14,7 +14,7 @@ class TestDurationHeaderOperations(DurationClientTestBase): @DurationPreparer() @recorded_by_proxy - def test_default(self, duration_endpoint): + def test_header_default(self, duration_endpoint): client = self.create_client(endpoint=duration_endpoint) response = client.header.default( duration="1 day, 0:00:00", @@ -25,7 +25,7 @@ def test_default(self, duration_endpoint): @DurationPreparer() @recorded_by_proxy - def test_iso8601(self, duration_endpoint): + def test_header_iso8601(self, duration_endpoint): client = self.create_client(endpoint=duration_endpoint) response = client.header.iso8601( duration="1 day, 0:00:00", @@ -36,7 +36,7 @@ def test_iso8601(self, duration_endpoint): @DurationPreparer() @recorded_by_proxy - def test_iso8601_array(self, duration_endpoint): + def test_header_iso8601_array(self, duration_endpoint): client = self.create_client(endpoint=duration_endpoint) response = client.header.iso8601_array( duration=["1 day, 0:00:00"], @@ -47,7 +47,7 @@ def test_iso8601_array(self, duration_endpoint): @DurationPreparer() @recorded_by_proxy - def test_int32_seconds(self, duration_endpoint): + def test_header_int32_seconds(self, duration_endpoint): client = self.create_client(endpoint=duration_endpoint) response = client.header.int32_seconds( duration=0, @@ -58,7 +58,7 @@ def test_int32_seconds(self, duration_endpoint): @DurationPreparer() @recorded_by_proxy - def test_float_seconds(self, duration_endpoint): + def test_header_float_seconds(self, duration_endpoint): client = self.create_client(endpoint=duration_endpoint) response = client.header.float_seconds( duration=0.0, @@ -69,7 +69,7 @@ def test_float_seconds(self, duration_endpoint): @DurationPreparer() @recorded_by_proxy - def test_float64_seconds(self, duration_endpoint): + def test_header_float64_seconds(self, duration_endpoint): client = self.create_client(endpoint=duration_endpoint) response = client.header.float64_seconds( duration=0.0, diff --git a/packages/typespec-python/test/azure/generated/encode-duration/generated_tests/test_duration_header_operations_async.py b/packages/typespec-python/test/azure/generated/encode-duration/generated_tests/test_duration_header_operations_async.py index 42a08e80f61..8437b4e599c 100644 --- a/packages/typespec-python/test/azure/generated/encode-duration/generated_tests/test_duration_header_operations_async.py +++ b/packages/typespec-python/test/azure/generated/encode-duration/generated_tests/test_duration_header_operations_async.py @@ -15,7 +15,7 @@ class TestDurationHeaderOperationsAsync(DurationClientTestBaseAsync): @DurationPreparer() @recorded_by_proxy_async - async def test_default(self, duration_endpoint): + async def test_header_default(self, duration_endpoint): client = self.create_async_client(endpoint=duration_endpoint) response = await client.header.default( duration="1 day, 0:00:00", @@ -26,7 +26,7 @@ async def test_default(self, duration_endpoint): @DurationPreparer() @recorded_by_proxy_async - async def test_iso8601(self, duration_endpoint): + async def test_header_iso8601(self, duration_endpoint): client = self.create_async_client(endpoint=duration_endpoint) response = await client.header.iso8601( duration="1 day, 0:00:00", @@ -37,7 +37,7 @@ async def test_iso8601(self, duration_endpoint): @DurationPreparer() @recorded_by_proxy_async - async def test_iso8601_array(self, duration_endpoint): + async def test_header_iso8601_array(self, duration_endpoint): client = self.create_async_client(endpoint=duration_endpoint) response = await client.header.iso8601_array( duration=["1 day, 0:00:00"], @@ -48,7 +48,7 @@ async def test_iso8601_array(self, duration_endpoint): @DurationPreparer() @recorded_by_proxy_async - async def test_int32_seconds(self, duration_endpoint): + async def test_header_int32_seconds(self, duration_endpoint): client = self.create_async_client(endpoint=duration_endpoint) response = await client.header.int32_seconds( duration=0, @@ -59,7 +59,7 @@ async def test_int32_seconds(self, duration_endpoint): @DurationPreparer() @recorded_by_proxy_async - async def test_float_seconds(self, duration_endpoint): + async def test_header_float_seconds(self, duration_endpoint): client = self.create_async_client(endpoint=duration_endpoint) response = await client.header.float_seconds( duration=0.0, @@ -70,7 +70,7 @@ async def test_float_seconds(self, duration_endpoint): @DurationPreparer() @recorded_by_proxy_async - async def test_float64_seconds(self, duration_endpoint): + async def test_header_float64_seconds(self, duration_endpoint): client = self.create_async_client(endpoint=duration_endpoint) response = await client.header.float64_seconds( duration=0.0, diff --git a/packages/typespec-python/test/azure/generated/encode-duration/generated_tests/test_duration_property_operations.py b/packages/typespec-python/test/azure/generated/encode-duration/generated_tests/test_duration_property_operations.py index 5295faefb08..696c38e6897 100644 --- a/packages/typespec-python/test/azure/generated/encode-duration/generated_tests/test_duration_property_operations.py +++ b/packages/typespec-python/test/azure/generated/encode-duration/generated_tests/test_duration_property_operations.py @@ -14,7 +14,7 @@ class TestDurationPropertyOperations(DurationClientTestBase): @DurationPreparer() @recorded_by_proxy - def test_default(self, duration_endpoint): + def test_property_default(self, duration_endpoint): client = self.create_client(endpoint=duration_endpoint) response = client.property.default( body={"value": "1 day, 0:00:00"}, @@ -25,7 +25,7 @@ def test_default(self, duration_endpoint): @DurationPreparer() @recorded_by_proxy - def test_iso8601(self, duration_endpoint): + def test_property_iso8601(self, duration_endpoint): client = self.create_client(endpoint=duration_endpoint) response = client.property.iso8601( body={"value": "1 day, 0:00:00"}, @@ -36,7 +36,7 @@ def test_iso8601(self, duration_endpoint): @DurationPreparer() @recorded_by_proxy - def test_int32_seconds(self, duration_endpoint): + def test_property_int32_seconds(self, duration_endpoint): client = self.create_client(endpoint=duration_endpoint) response = client.property.int32_seconds( body={"value": 0}, @@ -47,7 +47,7 @@ def test_int32_seconds(self, duration_endpoint): @DurationPreparer() @recorded_by_proxy - def test_float_seconds(self, duration_endpoint): + def test_property_float_seconds(self, duration_endpoint): client = self.create_client(endpoint=duration_endpoint) response = client.property.float_seconds( body={"value": 0.0}, @@ -58,7 +58,7 @@ def test_float_seconds(self, duration_endpoint): @DurationPreparer() @recorded_by_proxy - def test_float64_seconds(self, duration_endpoint): + def test_property_float64_seconds(self, duration_endpoint): client = self.create_client(endpoint=duration_endpoint) response = client.property.float64_seconds( body={"value": 0.0}, @@ -69,7 +69,7 @@ def test_float64_seconds(self, duration_endpoint): @DurationPreparer() @recorded_by_proxy - def test_float_seconds_array(self, duration_endpoint): + def test_property_float_seconds_array(self, duration_endpoint): client = self.create_client(endpoint=duration_endpoint) response = client.property.float_seconds_array( body={"value": [0.0]}, diff --git a/packages/typespec-python/test/azure/generated/encode-duration/generated_tests/test_duration_property_operations_async.py b/packages/typespec-python/test/azure/generated/encode-duration/generated_tests/test_duration_property_operations_async.py index bf73c7dc33e..8b6db79b5d8 100644 --- a/packages/typespec-python/test/azure/generated/encode-duration/generated_tests/test_duration_property_operations_async.py +++ b/packages/typespec-python/test/azure/generated/encode-duration/generated_tests/test_duration_property_operations_async.py @@ -15,7 +15,7 @@ class TestDurationPropertyOperationsAsync(DurationClientTestBaseAsync): @DurationPreparer() @recorded_by_proxy_async - async def test_default(self, duration_endpoint): + async def test_property_default(self, duration_endpoint): client = self.create_async_client(endpoint=duration_endpoint) response = await client.property.default( body={"value": "1 day, 0:00:00"}, @@ -26,7 +26,7 @@ async def test_default(self, duration_endpoint): @DurationPreparer() @recorded_by_proxy_async - async def test_iso8601(self, duration_endpoint): + async def test_property_iso8601(self, duration_endpoint): client = self.create_async_client(endpoint=duration_endpoint) response = await client.property.iso8601( body={"value": "1 day, 0:00:00"}, @@ -37,7 +37,7 @@ async def test_iso8601(self, duration_endpoint): @DurationPreparer() @recorded_by_proxy_async - async def test_int32_seconds(self, duration_endpoint): + async def test_property_int32_seconds(self, duration_endpoint): client = self.create_async_client(endpoint=duration_endpoint) response = await client.property.int32_seconds( body={"value": 0}, @@ -48,7 +48,7 @@ async def test_int32_seconds(self, duration_endpoint): @DurationPreparer() @recorded_by_proxy_async - async def test_float_seconds(self, duration_endpoint): + async def test_property_float_seconds(self, duration_endpoint): client = self.create_async_client(endpoint=duration_endpoint) response = await client.property.float_seconds( body={"value": 0.0}, @@ -59,7 +59,7 @@ async def test_float_seconds(self, duration_endpoint): @DurationPreparer() @recorded_by_proxy_async - async def test_float64_seconds(self, duration_endpoint): + async def test_property_float64_seconds(self, duration_endpoint): client = self.create_async_client(endpoint=duration_endpoint) response = await client.property.float64_seconds( body={"value": 0.0}, @@ -70,7 +70,7 @@ async def test_float64_seconds(self, duration_endpoint): @DurationPreparer() @recorded_by_proxy_async - async def test_float_seconds_array(self, duration_endpoint): + async def test_property_float_seconds_array(self, duration_endpoint): client = self.create_async_client(endpoint=duration_endpoint) response = await client.property.float_seconds_array( body={"value": [0.0]}, diff --git a/packages/typespec-python/test/azure/generated/encode-duration/generated_tests/test_duration_query_operations.py b/packages/typespec-python/test/azure/generated/encode-duration/generated_tests/test_duration_query_operations.py index 56d3fe40113..f01cfb4019e 100644 --- a/packages/typespec-python/test/azure/generated/encode-duration/generated_tests/test_duration_query_operations.py +++ b/packages/typespec-python/test/azure/generated/encode-duration/generated_tests/test_duration_query_operations.py @@ -14,7 +14,7 @@ class TestDurationQueryOperations(DurationClientTestBase): @DurationPreparer() @recorded_by_proxy - def test_default(self, duration_endpoint): + def test_query_default(self, duration_endpoint): client = self.create_client(endpoint=duration_endpoint) response = client.query.default( input="1 day, 0:00:00", @@ -25,7 +25,7 @@ def test_default(self, duration_endpoint): @DurationPreparer() @recorded_by_proxy - def test_iso8601(self, duration_endpoint): + def test_query_iso8601(self, duration_endpoint): client = self.create_client(endpoint=duration_endpoint) response = client.query.iso8601( input="1 day, 0:00:00", @@ -36,7 +36,7 @@ def test_iso8601(self, duration_endpoint): @DurationPreparer() @recorded_by_proxy - def test_int32_seconds(self, duration_endpoint): + def test_query_int32_seconds(self, duration_endpoint): client = self.create_client(endpoint=duration_endpoint) response = client.query.int32_seconds( input=0, @@ -47,7 +47,7 @@ def test_int32_seconds(self, duration_endpoint): @DurationPreparer() @recorded_by_proxy - def test_float_seconds(self, duration_endpoint): + def test_query_float_seconds(self, duration_endpoint): client = self.create_client(endpoint=duration_endpoint) response = client.query.float_seconds( input=0.0, @@ -58,7 +58,7 @@ def test_float_seconds(self, duration_endpoint): @DurationPreparer() @recorded_by_proxy - def test_float64_seconds(self, duration_endpoint): + def test_query_float64_seconds(self, duration_endpoint): client = self.create_client(endpoint=duration_endpoint) response = client.query.float64_seconds( input=0.0, @@ -69,7 +69,7 @@ def test_float64_seconds(self, duration_endpoint): @DurationPreparer() @recorded_by_proxy - def test_int32_seconds_array(self, duration_endpoint): + def test_query_int32_seconds_array(self, duration_endpoint): client = self.create_client(endpoint=duration_endpoint) response = client.query.int32_seconds_array( input=[0], diff --git a/packages/typespec-python/test/azure/generated/encode-duration/generated_tests/test_duration_query_operations_async.py b/packages/typespec-python/test/azure/generated/encode-duration/generated_tests/test_duration_query_operations_async.py index a5297e40508..ce3da7ce8e0 100644 --- a/packages/typespec-python/test/azure/generated/encode-duration/generated_tests/test_duration_query_operations_async.py +++ b/packages/typespec-python/test/azure/generated/encode-duration/generated_tests/test_duration_query_operations_async.py @@ -15,7 +15,7 @@ class TestDurationQueryOperationsAsync(DurationClientTestBaseAsync): @DurationPreparer() @recorded_by_proxy_async - async def test_default(self, duration_endpoint): + async def test_query_default(self, duration_endpoint): client = self.create_async_client(endpoint=duration_endpoint) response = await client.query.default( input="1 day, 0:00:00", @@ -26,7 +26,7 @@ async def test_default(self, duration_endpoint): @DurationPreparer() @recorded_by_proxy_async - async def test_iso8601(self, duration_endpoint): + async def test_query_iso8601(self, duration_endpoint): client = self.create_async_client(endpoint=duration_endpoint) response = await client.query.iso8601( input="1 day, 0:00:00", @@ -37,7 +37,7 @@ async def test_iso8601(self, duration_endpoint): @DurationPreparer() @recorded_by_proxy_async - async def test_int32_seconds(self, duration_endpoint): + async def test_query_int32_seconds(self, duration_endpoint): client = self.create_async_client(endpoint=duration_endpoint) response = await client.query.int32_seconds( input=0, @@ -48,7 +48,7 @@ async def test_int32_seconds(self, duration_endpoint): @DurationPreparer() @recorded_by_proxy_async - async def test_float_seconds(self, duration_endpoint): + async def test_query_float_seconds(self, duration_endpoint): client = self.create_async_client(endpoint=duration_endpoint) response = await client.query.float_seconds( input=0.0, @@ -59,7 +59,7 @@ async def test_float_seconds(self, duration_endpoint): @DurationPreparer() @recorded_by_proxy_async - async def test_float64_seconds(self, duration_endpoint): + async def test_query_float64_seconds(self, duration_endpoint): client = self.create_async_client(endpoint=duration_endpoint) response = await client.query.float64_seconds( input=0.0, @@ -70,7 +70,7 @@ async def test_float64_seconds(self, duration_endpoint): @DurationPreparer() @recorded_by_proxy_async - async def test_int32_seconds_array(self, duration_endpoint): + async def test_query_int32_seconds_array(self, duration_endpoint): client = self.create_async_client(endpoint=duration_endpoint) response = await client.query.int32_seconds_array( input=[0], diff --git a/packages/typespec-python/test/azure/generated/encode-numeric/apiview_mapping_python.json b/packages/typespec-python/test/azure/generated/encode-numeric/apiview_mapping_python.json index 60382366439..14141434976 100644 --- a/packages/typespec-python/test/azure/generated/encode-numeric/apiview_mapping_python.json +++ b/packages/typespec-python/test/azure/generated/encode-numeric/apiview_mapping_python.json @@ -3,7 +3,9 @@ "CrossLanguageDefinitionId": { "encode.numeric.models.SafeintAsStringProperty": "Encode.Numeric.Property.SafeintAsStringProperty", "encode.numeric.models.Uint32AsStringProperty": "Encode.Numeric.Property.Uint32AsStringProperty", + "encode.numeric.models.Uint8AsStringProperty": "Encode.Numeric.Property.Uint8AsStringProperty", "encode.numeric.NumericClient.property.safeint_as_string": "Encode.Numeric.Property.safeintAsString", - "encode.numeric.NumericClient.property.uint32_as_string_optional": "Encode.Numeric.Property.uint32AsStringOptional" + "encode.numeric.NumericClient.property.uint32_as_string_optional": "Encode.Numeric.Property.uint32AsStringOptional", + "encode.numeric.NumericClient.property.uint8_as_string": "Encode.Numeric.Property.uint8AsString" } } \ No newline at end of file diff --git a/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/aio/operations/_operations.py index b767d0c08fa..36bb07440e5 100644 --- a/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/aio/operations/_operations.py @@ -31,6 +31,7 @@ from ...operations._operations import ( build_property_safeint_as_string_request, build_property_uint32_as_string_optional_request, + build_property_uint8_as_string_request, ) if sys.version_info >= (3, 9): @@ -61,12 +62,12 @@ def __init__(self, *args, **kwargs) -> None: @overload async def safeint_as_string( - self, body: _models.SafeintAsStringProperty, *, content_type: str = "application/json", **kwargs: Any + self, value: _models.SafeintAsStringProperty, *, content_type: str = "application/json", **kwargs: Any ) -> _models.SafeintAsStringProperty: """safeint_as_string. - :param body: Required. - :type body: ~encode.numeric.models.SafeintAsStringProperty + :param value: Required. + :type value: ~encode.numeric.models.SafeintAsStringProperty :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -77,12 +78,12 @@ async def safeint_as_string( @overload async def safeint_as_string( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, value: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.SafeintAsStringProperty: """safeint_as_string. - :param body: Required. - :type body: JSON + :param value: Required. + :type value: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -93,12 +94,12 @@ async def safeint_as_string( @overload async def safeint_as_string( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + self, value: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.SafeintAsStringProperty: """safeint_as_string. - :param body: Required. - :type body: IO[bytes] + :param value: Required. + :type value: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -109,12 +110,12 @@ async def safeint_as_string( @distributed_trace_async async def safeint_as_string( - self, body: Union[_models.SafeintAsStringProperty, JSON, IO[bytes]], **kwargs: Any + self, value: Union[_models.SafeintAsStringProperty, JSON, IO[bytes]], **kwargs: Any ) -> _models.SafeintAsStringProperty: """safeint_as_string. - :param body: Is one of the following types: SafeintAsStringProperty, JSON, IO[bytes] Required. - :type body: ~encode.numeric.models.SafeintAsStringProperty or JSON or IO[bytes] + :param value: Is one of the following types: SafeintAsStringProperty, JSON, IO[bytes] Required. + :type value: ~encode.numeric.models.SafeintAsStringProperty or JSON or IO[bytes] :return: SafeintAsStringProperty. The SafeintAsStringProperty is compatible with MutableMapping :rtype: ~encode.numeric.models.SafeintAsStringProperty :raises ~azure.core.exceptions.HttpResponseError: @@ -135,10 +136,10 @@ async def safeint_as_string( content_type = content_type or "application/json" _content = None - if isinstance(body, (IOBase, bytes)): - _content = body + if isinstance(value, (IOBase, bytes)): + _content = value else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(value, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_property_safeint_as_string_request( content_type=content_type, @@ -179,12 +180,12 @@ async def safeint_as_string( @overload async def uint32_as_string_optional( - self, body: _models.Uint32AsStringProperty, *, content_type: str = "application/json", **kwargs: Any + self, value: _models.Uint32AsStringProperty, *, content_type: str = "application/json", **kwargs: Any ) -> _models.Uint32AsStringProperty: """uint32_as_string_optional. - :param body: Required. - :type body: ~encode.numeric.models.Uint32AsStringProperty + :param value: Required. + :type value: ~encode.numeric.models.Uint32AsStringProperty :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -195,12 +196,12 @@ async def uint32_as_string_optional( @overload async def uint32_as_string_optional( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, value: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.Uint32AsStringProperty: """uint32_as_string_optional. - :param body: Required. - :type body: JSON + :param value: Required. + :type value: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -211,12 +212,12 @@ async def uint32_as_string_optional( @overload async def uint32_as_string_optional( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + self, value: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.Uint32AsStringProperty: """uint32_as_string_optional. - :param body: Required. - :type body: IO[bytes] + :param value: Required. + :type value: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -227,12 +228,12 @@ async def uint32_as_string_optional( @distributed_trace_async async def uint32_as_string_optional( - self, body: Union[_models.Uint32AsStringProperty, JSON, IO[bytes]], **kwargs: Any + self, value: Union[_models.Uint32AsStringProperty, JSON, IO[bytes]], **kwargs: Any ) -> _models.Uint32AsStringProperty: """uint32_as_string_optional. - :param body: Is one of the following types: Uint32AsStringProperty, JSON, IO[bytes] Required. - :type body: ~encode.numeric.models.Uint32AsStringProperty or JSON or IO[bytes] + :param value: Is one of the following types: Uint32AsStringProperty, JSON, IO[bytes] Required. + :type value: ~encode.numeric.models.Uint32AsStringProperty or JSON or IO[bytes] :return: Uint32AsStringProperty. The Uint32AsStringProperty is compatible with MutableMapping :rtype: ~encode.numeric.models.Uint32AsStringProperty :raises ~azure.core.exceptions.HttpResponseError: @@ -253,10 +254,10 @@ async def uint32_as_string_optional( content_type = content_type or "application/json" _content = None - if isinstance(body, (IOBase, bytes)): - _content = body + if isinstance(value, (IOBase, bytes)): + _content = value else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(value, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_property_uint32_as_string_optional_request( content_type=content_type, @@ -294,3 +295,121 @@ async def uint32_as_string_optional( return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore + + @overload + async def uint8_as_string( + self, value: _models.Uint8AsStringProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Uint8AsStringProperty: + """uint8_as_string. + + :param value: Required. + :type value: ~encode.numeric.models.Uint8AsStringProperty + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Uint8AsStringProperty. The Uint8AsStringProperty is compatible with MutableMapping + :rtype: ~encode.numeric.models.Uint8AsStringProperty + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def uint8_as_string( + self, value: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Uint8AsStringProperty: + """uint8_as_string. + + :param value: Required. + :type value: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Uint8AsStringProperty. The Uint8AsStringProperty is compatible with MutableMapping + :rtype: ~encode.numeric.models.Uint8AsStringProperty + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def uint8_as_string( + self, value: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Uint8AsStringProperty: + """uint8_as_string. + + :param value: Required. + :type value: 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: Uint8AsStringProperty. The Uint8AsStringProperty is compatible with MutableMapping + :rtype: ~encode.numeric.models.Uint8AsStringProperty + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def uint8_as_string( + self, value: Union[_models.Uint8AsStringProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models.Uint8AsStringProperty: + """uint8_as_string. + + :param value: Is one of the following types: Uint8AsStringProperty, JSON, IO[bytes] Required. + :type value: ~encode.numeric.models.Uint8AsStringProperty or JSON or IO[bytes] + :return: Uint8AsStringProperty. The Uint8AsStringProperty is compatible with MutableMapping + :rtype: ~encode.numeric.models.Uint8AsStringProperty + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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[_models.Uint8AsStringProperty] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(value, (IOBase, bytes)): + _content = value + else: + _content = json.dumps(value, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_property_uint8_as_string_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(_models.Uint8AsStringProperty, 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-numeric/encode/numeric/models/__init__.py b/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/models/__init__.py index 858e849a13c..d1843df2662 100644 --- a/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/models/__init__.py +++ b/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/models/__init__.py @@ -8,6 +8,7 @@ from ._models import SafeintAsStringProperty from ._models import Uint32AsStringProperty +from ._models import Uint8AsStringProperty from ._patch import __all__ as _patch_all from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk @@ -15,6 +16,7 @@ __all__ = [ "SafeintAsStringProperty", "Uint32AsStringProperty", + "Uint8AsStringProperty", ] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/models/_models.py b/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/models/_models.py index 82eadf8b3e3..3e259d9b614 100644 --- a/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/models/_models.py +++ b/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/models/_models.py @@ -67,3 +67,32 @@ def __init__(self, mapping: Mapping[str, Any]): def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation super().__init__(*args, **kwargs) + + +class Uint8AsStringProperty(_model_base.Model): + """Uint8AsStringProperty. + + + :ivar value: Required. + :vartype value: int + """ + + value: int = rest_field(format="str") + """Required.""" + + @overload + def __init__( + self, + *, + value: int, + ): ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) diff --git a/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/operations/_operations.py b/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/operations/_operations.py index 30c22b014bf..d4af4b5133e 100644 --- a/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/encode-numeric/encode/numeric/operations/_operations.py @@ -76,6 +76,23 @@ def build_property_uint32_as_string_optional_request(**kwargs: Any) -> HttpReque return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) +def build_property_uint8_as_string_request(**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/numeric/property/uint8" + + # 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:: @@ -95,12 +112,12 @@ def __init__(self, *args, **kwargs): @overload def safeint_as_string( - self, body: _models.SafeintAsStringProperty, *, content_type: str = "application/json", **kwargs: Any + self, value: _models.SafeintAsStringProperty, *, content_type: str = "application/json", **kwargs: Any ) -> _models.SafeintAsStringProperty: """safeint_as_string. - :param body: Required. - :type body: ~encode.numeric.models.SafeintAsStringProperty + :param value: Required. + :type value: ~encode.numeric.models.SafeintAsStringProperty :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -111,12 +128,12 @@ def safeint_as_string( @overload def safeint_as_string( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, value: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.SafeintAsStringProperty: """safeint_as_string. - :param body: Required. - :type body: JSON + :param value: Required. + :type value: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -127,12 +144,12 @@ def safeint_as_string( @overload def safeint_as_string( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + self, value: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.SafeintAsStringProperty: """safeint_as_string. - :param body: Required. - :type body: IO[bytes] + :param value: Required. + :type value: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -143,12 +160,12 @@ def safeint_as_string( @distributed_trace def safeint_as_string( - self, body: Union[_models.SafeintAsStringProperty, JSON, IO[bytes]], **kwargs: Any + self, value: Union[_models.SafeintAsStringProperty, JSON, IO[bytes]], **kwargs: Any ) -> _models.SafeintAsStringProperty: """safeint_as_string. - :param body: Is one of the following types: SafeintAsStringProperty, JSON, IO[bytes] Required. - :type body: ~encode.numeric.models.SafeintAsStringProperty or JSON or IO[bytes] + :param value: Is one of the following types: SafeintAsStringProperty, JSON, IO[bytes] Required. + :type value: ~encode.numeric.models.SafeintAsStringProperty or JSON or IO[bytes] :return: SafeintAsStringProperty. The SafeintAsStringProperty is compatible with MutableMapping :rtype: ~encode.numeric.models.SafeintAsStringProperty :raises ~azure.core.exceptions.HttpResponseError: @@ -169,10 +186,10 @@ def safeint_as_string( content_type = content_type or "application/json" _content = None - if isinstance(body, (IOBase, bytes)): - _content = body + if isinstance(value, (IOBase, bytes)): + _content = value else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(value, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_property_safeint_as_string_request( content_type=content_type, @@ -213,12 +230,12 @@ def safeint_as_string( @overload def uint32_as_string_optional( - self, body: _models.Uint32AsStringProperty, *, content_type: str = "application/json", **kwargs: Any + self, value: _models.Uint32AsStringProperty, *, content_type: str = "application/json", **kwargs: Any ) -> _models.Uint32AsStringProperty: """uint32_as_string_optional. - :param body: Required. - :type body: ~encode.numeric.models.Uint32AsStringProperty + :param value: Required. + :type value: ~encode.numeric.models.Uint32AsStringProperty :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -229,12 +246,12 @@ def uint32_as_string_optional( @overload def uint32_as_string_optional( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, value: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.Uint32AsStringProperty: """uint32_as_string_optional. - :param body: Required. - :type body: JSON + :param value: Required. + :type value: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -245,12 +262,12 @@ def uint32_as_string_optional( @overload def uint32_as_string_optional( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + self, value: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.Uint32AsStringProperty: """uint32_as_string_optional. - :param body: Required. - :type body: IO[bytes] + :param value: Required. + :type value: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -261,12 +278,12 @@ def uint32_as_string_optional( @distributed_trace def uint32_as_string_optional( - self, body: Union[_models.Uint32AsStringProperty, JSON, IO[bytes]], **kwargs: Any + self, value: Union[_models.Uint32AsStringProperty, JSON, IO[bytes]], **kwargs: Any ) -> _models.Uint32AsStringProperty: """uint32_as_string_optional. - :param body: Is one of the following types: Uint32AsStringProperty, JSON, IO[bytes] Required. - :type body: ~encode.numeric.models.Uint32AsStringProperty or JSON or IO[bytes] + :param value: Is one of the following types: Uint32AsStringProperty, JSON, IO[bytes] Required. + :type value: ~encode.numeric.models.Uint32AsStringProperty or JSON or IO[bytes] :return: Uint32AsStringProperty. The Uint32AsStringProperty is compatible with MutableMapping :rtype: ~encode.numeric.models.Uint32AsStringProperty :raises ~azure.core.exceptions.HttpResponseError: @@ -287,10 +304,10 @@ def uint32_as_string_optional( content_type = content_type or "application/json" _content = None - if isinstance(body, (IOBase, bytes)): - _content = body + if isinstance(value, (IOBase, bytes)): + _content = value else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(value, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_property_uint32_as_string_optional_request( content_type=content_type, @@ -328,3 +345,121 @@ def uint32_as_string_optional( return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore + + @overload + def uint8_as_string( + self, value: _models.Uint8AsStringProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Uint8AsStringProperty: + """uint8_as_string. + + :param value: Required. + :type value: ~encode.numeric.models.Uint8AsStringProperty + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Uint8AsStringProperty. The Uint8AsStringProperty is compatible with MutableMapping + :rtype: ~encode.numeric.models.Uint8AsStringProperty + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def uint8_as_string( + self, value: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Uint8AsStringProperty: + """uint8_as_string. + + :param value: Required. + :type value: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Uint8AsStringProperty. The Uint8AsStringProperty is compatible with MutableMapping + :rtype: ~encode.numeric.models.Uint8AsStringProperty + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def uint8_as_string( + self, value: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Uint8AsStringProperty: + """uint8_as_string. + + :param value: Required. + :type value: 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: Uint8AsStringProperty. The Uint8AsStringProperty is compatible with MutableMapping + :rtype: ~encode.numeric.models.Uint8AsStringProperty + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def uint8_as_string( + self, value: Union[_models.Uint8AsStringProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models.Uint8AsStringProperty: + """uint8_as_string. + + :param value: Is one of the following types: Uint8AsStringProperty, JSON, IO[bytes] Required. + :type value: ~encode.numeric.models.Uint8AsStringProperty or JSON or IO[bytes] + :return: Uint8AsStringProperty. The Uint8AsStringProperty is compatible with MutableMapping + :rtype: ~encode.numeric.models.Uint8AsStringProperty + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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[_models.Uint8AsStringProperty] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(value, (IOBase, bytes)): + _content = value + else: + _content = json.dumps(value, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_property_uint8_as_string_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(_models.Uint8AsStringProperty, 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-numeric/generated_tests/test_numeric_property_operations.py b/packages/typespec-python/test/azure/generated/encode-numeric/generated_tests/test_numeric_property_operations.py index 26e7d29b398..fffcf2d5f4e 100644 --- a/packages/typespec-python/test/azure/generated/encode-numeric/generated_tests/test_numeric_property_operations.py +++ b/packages/typespec-python/test/azure/generated/encode-numeric/generated_tests/test_numeric_property_operations.py @@ -14,10 +14,10 @@ class TestNumericPropertyOperations(NumericClientTestBase): @NumericPreparer() @recorded_by_proxy - def test_safeint_as_string(self, numeric_endpoint): + def test_property_safeint_as_string(self, numeric_endpoint): client = self.create_client(endpoint=numeric_endpoint) response = client.property.safeint_as_string( - body={"value": 0}, + value={"value": 0}, ) # please add some check logic here by yourself @@ -25,10 +25,21 @@ def test_safeint_as_string(self, numeric_endpoint): @NumericPreparer() @recorded_by_proxy - def test_uint32_as_string_optional(self, numeric_endpoint): + def test_property_uint32_as_string_optional(self, numeric_endpoint): client = self.create_client(endpoint=numeric_endpoint) response = client.property.uint32_as_string_optional( - body={"value": 0}, + value={"value": 0}, + ) + + # please add some check logic here by yourself + # ... + + @NumericPreparer() + @recorded_by_proxy + def test_property_uint8_as_string(self, numeric_endpoint): + client = self.create_client(endpoint=numeric_endpoint) + response = client.property.uint8_as_string( + value={"value": 0}, ) # please add some check logic here by yourself diff --git a/packages/typespec-python/test/azure/generated/encode-numeric/generated_tests/test_numeric_property_operations_async.py b/packages/typespec-python/test/azure/generated/encode-numeric/generated_tests/test_numeric_property_operations_async.py index d3c22ec5344..8de4f2ad73e 100644 --- a/packages/typespec-python/test/azure/generated/encode-numeric/generated_tests/test_numeric_property_operations_async.py +++ b/packages/typespec-python/test/azure/generated/encode-numeric/generated_tests/test_numeric_property_operations_async.py @@ -15,10 +15,10 @@ class TestNumericPropertyOperationsAsync(NumericClientTestBaseAsync): @NumericPreparer() @recorded_by_proxy_async - async def test_safeint_as_string(self, numeric_endpoint): + async def test_property_safeint_as_string(self, numeric_endpoint): client = self.create_async_client(endpoint=numeric_endpoint) response = await client.property.safeint_as_string( - body={"value": 0}, + value={"value": 0}, ) # please add some check logic here by yourself @@ -26,10 +26,21 @@ async def test_safeint_as_string(self, numeric_endpoint): @NumericPreparer() @recorded_by_proxy_async - async def test_uint32_as_string_optional(self, numeric_endpoint): + async def test_property_uint32_as_string_optional(self, numeric_endpoint): client = self.create_async_client(endpoint=numeric_endpoint) response = await client.property.uint32_as_string_optional( - body={"value": 0}, + value={"value": 0}, + ) + + # please add some check logic here by yourself + # ... + + @NumericPreparer() + @recorded_by_proxy_async + async def test_property_uint8_as_string(self, numeric_endpoint): + client = self.create_async_client(endpoint=numeric_endpoint) + response = await client.property.uint8_as_string( + value={"value": 0}, ) # please add some check logic here by yourself diff --git a/packages/typespec-python/test/azure/generated/parameters-basic/generated_tests/test_basic_explicit_body_operations.py b/packages/typespec-python/test/azure/generated/parameters-basic/generated_tests/test_basic_explicit_body_operations.py index 34c972a526d..a764b421795 100644 --- a/packages/typespec-python/test/azure/generated/parameters-basic/generated_tests/test_basic_explicit_body_operations.py +++ b/packages/typespec-python/test/azure/generated/parameters-basic/generated_tests/test_basic_explicit_body_operations.py @@ -14,7 +14,7 @@ class TestBasicExplicitBodyOperations(BasicClientTestBase): @BasicPreparer() @recorded_by_proxy - def test_simple(self, basic_endpoint): + def test_explicit_body_simple(self, basic_endpoint): client = self.create_client(endpoint=basic_endpoint) response = client.explicit_body.simple( body={"name": "str"}, diff --git a/packages/typespec-python/test/azure/generated/parameters-basic/generated_tests/test_basic_explicit_body_operations_async.py b/packages/typespec-python/test/azure/generated/parameters-basic/generated_tests/test_basic_explicit_body_operations_async.py index 206e3ad1933..bef8dd97225 100644 --- a/packages/typespec-python/test/azure/generated/parameters-basic/generated_tests/test_basic_explicit_body_operations_async.py +++ b/packages/typespec-python/test/azure/generated/parameters-basic/generated_tests/test_basic_explicit_body_operations_async.py @@ -15,7 +15,7 @@ class TestBasicExplicitBodyOperationsAsync(BasicClientTestBaseAsync): @BasicPreparer() @recorded_by_proxy_async - async def test_simple(self, basic_endpoint): + async def test_explicit_body_simple(self, basic_endpoint): client = self.create_async_client(endpoint=basic_endpoint) response = await client.explicit_body.simple( body={"name": "str"}, diff --git a/packages/typespec-python/test/azure/generated/parameters-basic/generated_tests/test_basic_implicit_body_operations.py b/packages/typespec-python/test/azure/generated/parameters-basic/generated_tests/test_basic_implicit_body_operations.py index 212075fa707..525c35f6dd0 100644 --- a/packages/typespec-python/test/azure/generated/parameters-basic/generated_tests/test_basic_implicit_body_operations.py +++ b/packages/typespec-python/test/azure/generated/parameters-basic/generated_tests/test_basic_implicit_body_operations.py @@ -14,7 +14,7 @@ class TestBasicImplicitBodyOperations(BasicClientTestBase): @BasicPreparer() @recorded_by_proxy - def test_simple(self, basic_endpoint): + def test_implicit_body_simple(self, basic_endpoint): client = self.create_client(endpoint=basic_endpoint) response = client.implicit_body.simple( body={"name": "str"}, diff --git a/packages/typespec-python/test/azure/generated/parameters-basic/generated_tests/test_basic_implicit_body_operations_async.py b/packages/typespec-python/test/azure/generated/parameters-basic/generated_tests/test_basic_implicit_body_operations_async.py index 9fdcd2536c0..83322a2b281 100644 --- a/packages/typespec-python/test/azure/generated/parameters-basic/generated_tests/test_basic_implicit_body_operations_async.py +++ b/packages/typespec-python/test/azure/generated/parameters-basic/generated_tests/test_basic_implicit_body_operations_async.py @@ -15,7 +15,7 @@ class TestBasicImplicitBodyOperationsAsync(BasicClientTestBaseAsync): @BasicPreparer() @recorded_by_proxy_async - async def test_simple(self, basic_endpoint): + async def test_implicit_body_simple(self, basic_endpoint): client = self.create_async_client(endpoint=basic_endpoint) response = await client.implicit_body.simple( body={"name": "str"}, diff --git a/packages/typespec-python/test/azure/generated/parameters-body-optionality/generated_tests/test_body_optionality_optional_explicit_operations.py b/packages/typespec-python/test/azure/generated/parameters-body-optionality/generated_tests/test_body_optionality_optional_explicit_operations.py index 7f36ac73ebd..5dfe0e95ed4 100644 --- a/packages/typespec-python/test/azure/generated/parameters-body-optionality/generated_tests/test_body_optionality_optional_explicit_operations.py +++ b/packages/typespec-python/test/azure/generated/parameters-body-optionality/generated_tests/test_body_optionality_optional_explicit_operations.py @@ -14,7 +14,7 @@ class TestBodyOptionalityOptionalExplicitOperations(BodyOptionalityClientTestBase): @BodyOptionalityPreparer() @recorded_by_proxy - def test_set(self, bodyoptionality_endpoint): + def test_optional_explicit_set(self, bodyoptionality_endpoint): client = self.create_client(endpoint=bodyoptionality_endpoint) response = client.optional_explicit.set() @@ -23,7 +23,7 @@ def test_set(self, bodyoptionality_endpoint): @BodyOptionalityPreparer() @recorded_by_proxy - def test_omit(self, bodyoptionality_endpoint): + def test_optional_explicit_omit(self, bodyoptionality_endpoint): client = self.create_client(endpoint=bodyoptionality_endpoint) response = client.optional_explicit.omit() diff --git a/packages/typespec-python/test/azure/generated/parameters-body-optionality/generated_tests/test_body_optionality_optional_explicit_operations_async.py b/packages/typespec-python/test/azure/generated/parameters-body-optionality/generated_tests/test_body_optionality_optional_explicit_operations_async.py index 4f6487a0973..aa6ee862b35 100644 --- a/packages/typespec-python/test/azure/generated/parameters-body-optionality/generated_tests/test_body_optionality_optional_explicit_operations_async.py +++ b/packages/typespec-python/test/azure/generated/parameters-body-optionality/generated_tests/test_body_optionality_optional_explicit_operations_async.py @@ -15,7 +15,7 @@ class TestBodyOptionalityOptionalExplicitOperationsAsync(BodyOptionalityClientTestBaseAsync): @BodyOptionalityPreparer() @recorded_by_proxy_async - async def test_set(self, bodyoptionality_endpoint): + async def test_optional_explicit_set(self, bodyoptionality_endpoint): client = self.create_async_client(endpoint=bodyoptionality_endpoint) response = await client.optional_explicit.set() @@ -24,7 +24,7 @@ async def test_set(self, bodyoptionality_endpoint): @BodyOptionalityPreparer() @recorded_by_proxy_async - async def test_omit(self, bodyoptionality_endpoint): + async def test_optional_explicit_omit(self, bodyoptionality_endpoint): client = self.create_async_client(endpoint=bodyoptionality_endpoint) response = await client.optional_explicit.omit() diff --git a/packages/typespec-python/test/azure/generated/parameters-collection-format/generated_tests/test_collection_format_header_operations.py b/packages/typespec-python/test/azure/generated/parameters-collection-format/generated_tests/test_collection_format_header_operations.py index c59ef5069eb..8d22f920b98 100644 --- a/packages/typespec-python/test/azure/generated/parameters-collection-format/generated_tests/test_collection_format_header_operations.py +++ b/packages/typespec-python/test/azure/generated/parameters-collection-format/generated_tests/test_collection_format_header_operations.py @@ -14,7 +14,7 @@ class TestCollectionFormatHeaderOperations(CollectionFormatClientTestBase): @CollectionFormatPreparer() @recorded_by_proxy - def test_csv(self, collectionformat_endpoint): + def test_header_csv(self, collectionformat_endpoint): client = self.create_client(endpoint=collectionformat_endpoint) response = client.header.csv( colors=["str"], diff --git a/packages/typespec-python/test/azure/generated/parameters-collection-format/generated_tests/test_collection_format_header_operations_async.py b/packages/typespec-python/test/azure/generated/parameters-collection-format/generated_tests/test_collection_format_header_operations_async.py index d5647b69ce8..3b596202fb2 100644 --- a/packages/typespec-python/test/azure/generated/parameters-collection-format/generated_tests/test_collection_format_header_operations_async.py +++ b/packages/typespec-python/test/azure/generated/parameters-collection-format/generated_tests/test_collection_format_header_operations_async.py @@ -15,7 +15,7 @@ class TestCollectionFormatHeaderOperationsAsync(CollectionFormatClientTestBaseAsync): @CollectionFormatPreparer() @recorded_by_proxy_async - async def test_csv(self, collectionformat_endpoint): + async def test_header_csv(self, collectionformat_endpoint): client = self.create_async_client(endpoint=collectionformat_endpoint) response = await client.header.csv( colors=["str"], diff --git a/packages/typespec-python/test/azure/generated/parameters-collection-format/generated_tests/test_collection_format_query_operations.py b/packages/typespec-python/test/azure/generated/parameters-collection-format/generated_tests/test_collection_format_query_operations.py index c706e5a1bc4..12397560740 100644 --- a/packages/typespec-python/test/azure/generated/parameters-collection-format/generated_tests/test_collection_format_query_operations.py +++ b/packages/typespec-python/test/azure/generated/parameters-collection-format/generated_tests/test_collection_format_query_operations.py @@ -14,7 +14,7 @@ class TestCollectionFormatQueryOperations(CollectionFormatClientTestBase): @CollectionFormatPreparer() @recorded_by_proxy - def test_multi(self, collectionformat_endpoint): + def test_query_multi(self, collectionformat_endpoint): client = self.create_client(endpoint=collectionformat_endpoint) response = client.query.multi( colors=["str"], @@ -25,7 +25,7 @@ def test_multi(self, collectionformat_endpoint): @CollectionFormatPreparer() @recorded_by_proxy - def test_ssv(self, collectionformat_endpoint): + def test_query_ssv(self, collectionformat_endpoint): client = self.create_client(endpoint=collectionformat_endpoint) response = client.query.ssv( colors=["str"], @@ -36,7 +36,7 @@ def test_ssv(self, collectionformat_endpoint): @CollectionFormatPreparer() @recorded_by_proxy - def test_tsv(self, collectionformat_endpoint): + def test_query_tsv(self, collectionformat_endpoint): client = self.create_client(endpoint=collectionformat_endpoint) response = client.query.tsv( colors=["str"], @@ -47,7 +47,7 @@ def test_tsv(self, collectionformat_endpoint): @CollectionFormatPreparer() @recorded_by_proxy - def test_pipes(self, collectionformat_endpoint): + def test_query_pipes(self, collectionformat_endpoint): client = self.create_client(endpoint=collectionformat_endpoint) response = client.query.pipes( colors=["str"], @@ -58,7 +58,7 @@ def test_pipes(self, collectionformat_endpoint): @CollectionFormatPreparer() @recorded_by_proxy - def test_csv(self, collectionformat_endpoint): + def test_query_csv(self, collectionformat_endpoint): client = self.create_client(endpoint=collectionformat_endpoint) response = client.query.csv( colors=["str"], diff --git a/packages/typespec-python/test/azure/generated/parameters-collection-format/generated_tests/test_collection_format_query_operations_async.py b/packages/typespec-python/test/azure/generated/parameters-collection-format/generated_tests/test_collection_format_query_operations_async.py index 178e77e1225..4a73943c601 100644 --- a/packages/typespec-python/test/azure/generated/parameters-collection-format/generated_tests/test_collection_format_query_operations_async.py +++ b/packages/typespec-python/test/azure/generated/parameters-collection-format/generated_tests/test_collection_format_query_operations_async.py @@ -15,7 +15,7 @@ class TestCollectionFormatQueryOperationsAsync(CollectionFormatClientTestBaseAsync): @CollectionFormatPreparer() @recorded_by_proxy_async - async def test_multi(self, collectionformat_endpoint): + async def test_query_multi(self, collectionformat_endpoint): client = self.create_async_client(endpoint=collectionformat_endpoint) response = await client.query.multi( colors=["str"], @@ -26,7 +26,7 @@ async def test_multi(self, collectionformat_endpoint): @CollectionFormatPreparer() @recorded_by_proxy_async - async def test_ssv(self, collectionformat_endpoint): + async def test_query_ssv(self, collectionformat_endpoint): client = self.create_async_client(endpoint=collectionformat_endpoint) response = await client.query.ssv( colors=["str"], @@ -37,7 +37,7 @@ async def test_ssv(self, collectionformat_endpoint): @CollectionFormatPreparer() @recorded_by_proxy_async - async def test_tsv(self, collectionformat_endpoint): + async def test_query_tsv(self, collectionformat_endpoint): client = self.create_async_client(endpoint=collectionformat_endpoint) response = await client.query.tsv( colors=["str"], @@ -48,7 +48,7 @@ async def test_tsv(self, collectionformat_endpoint): @CollectionFormatPreparer() @recorded_by_proxy_async - async def test_pipes(self, collectionformat_endpoint): + async def test_query_pipes(self, collectionformat_endpoint): client = self.create_async_client(endpoint=collectionformat_endpoint) response = await client.query.pipes( colors=["str"], @@ -59,7 +59,7 @@ async def test_pipes(self, collectionformat_endpoint): @CollectionFormatPreparer() @recorded_by_proxy_async - async def test_csv(self, collectionformat_endpoint): + async def test_query_csv(self, collectionformat_endpoint): client = self.create_async_client(endpoint=collectionformat_endpoint) response = await client.query.csv( colors=["str"], diff --git a/packages/typespec-python/test/azure/generated/parameters-spread/generated_tests/test_spread_alias_operations.py b/packages/typespec-python/test/azure/generated/parameters-spread/generated_tests/test_spread_alias_operations.py index ec09717a44e..c1be4f1f508 100644 --- a/packages/typespec-python/test/azure/generated/parameters-spread/generated_tests/test_spread_alias_operations.py +++ b/packages/typespec-python/test/azure/generated/parameters-spread/generated_tests/test_spread_alias_operations.py @@ -14,7 +14,7 @@ class TestSpreadAliasOperations(SpreadClientTestBase): @SpreadPreparer() @recorded_by_proxy - def test_spread_as_request_body(self, spread_endpoint): + def test_alias_spread_as_request_body(self, spread_endpoint): client = self.create_client(endpoint=spread_endpoint) response = client.alias.spread_as_request_body( body={"name": "str"}, @@ -26,7 +26,7 @@ def test_spread_as_request_body(self, spread_endpoint): @SpreadPreparer() @recorded_by_proxy - def test_spread_parameter_with_inner_model(self, spread_endpoint): + def test_alias_spread_parameter_with_inner_model(self, spread_endpoint): client = self.create_client(endpoint=spread_endpoint) response = client.alias.spread_parameter_with_inner_model( id="str", @@ -40,7 +40,7 @@ def test_spread_parameter_with_inner_model(self, spread_endpoint): @SpreadPreparer() @recorded_by_proxy - def test_spread_as_request_parameter(self, spread_endpoint): + def test_alias_spread_as_request_parameter(self, spread_endpoint): client = self.create_client(endpoint=spread_endpoint) response = client.alias.spread_as_request_parameter( id="str", @@ -54,7 +54,7 @@ def test_spread_as_request_parameter(self, spread_endpoint): @SpreadPreparer() @recorded_by_proxy - def test_spread_with_multiple_parameters(self, spread_endpoint): + def test_alias_spread_with_multiple_parameters(self, spread_endpoint): client = self.create_client(endpoint=spread_endpoint) response = client.alias.spread_with_multiple_parameters( id="str", @@ -69,7 +69,7 @@ def test_spread_with_multiple_parameters(self, spread_endpoint): @SpreadPreparer() @recorded_by_proxy - def test_spread_parameter_with_inner_alias(self, spread_endpoint): + def test_alias_spread_parameter_with_inner_alias(self, spread_endpoint): client = self.create_client(endpoint=spread_endpoint) response = client.alias.spread_parameter_with_inner_alias( id="str", diff --git a/packages/typespec-python/test/azure/generated/parameters-spread/generated_tests/test_spread_alias_operations_async.py b/packages/typespec-python/test/azure/generated/parameters-spread/generated_tests/test_spread_alias_operations_async.py index 1dcca282e92..e54868a73d8 100644 --- a/packages/typespec-python/test/azure/generated/parameters-spread/generated_tests/test_spread_alias_operations_async.py +++ b/packages/typespec-python/test/azure/generated/parameters-spread/generated_tests/test_spread_alias_operations_async.py @@ -15,7 +15,7 @@ class TestSpreadAliasOperationsAsync(SpreadClientTestBaseAsync): @SpreadPreparer() @recorded_by_proxy_async - async def test_spread_as_request_body(self, spread_endpoint): + async def test_alias_spread_as_request_body(self, spread_endpoint): client = self.create_async_client(endpoint=spread_endpoint) response = await client.alias.spread_as_request_body( body={"name": "str"}, @@ -27,7 +27,7 @@ async def test_spread_as_request_body(self, spread_endpoint): @SpreadPreparer() @recorded_by_proxy_async - async def test_spread_parameter_with_inner_model(self, spread_endpoint): + async def test_alias_spread_parameter_with_inner_model(self, spread_endpoint): client = self.create_async_client(endpoint=spread_endpoint) response = await client.alias.spread_parameter_with_inner_model( id="str", @@ -41,7 +41,7 @@ async def test_spread_parameter_with_inner_model(self, spread_endpoint): @SpreadPreparer() @recorded_by_proxy_async - async def test_spread_as_request_parameter(self, spread_endpoint): + async def test_alias_spread_as_request_parameter(self, spread_endpoint): client = self.create_async_client(endpoint=spread_endpoint) response = await client.alias.spread_as_request_parameter( id="str", @@ -55,7 +55,7 @@ async def test_spread_as_request_parameter(self, spread_endpoint): @SpreadPreparer() @recorded_by_proxy_async - async def test_spread_with_multiple_parameters(self, spread_endpoint): + async def test_alias_spread_with_multiple_parameters(self, spread_endpoint): client = self.create_async_client(endpoint=spread_endpoint) response = await client.alias.spread_with_multiple_parameters( id="str", @@ -70,7 +70,7 @@ async def test_spread_with_multiple_parameters(self, spread_endpoint): @SpreadPreparer() @recorded_by_proxy_async - async def test_spread_parameter_with_inner_alias(self, spread_endpoint): + async def test_alias_spread_parameter_with_inner_alias(self, spread_endpoint): client = self.create_async_client(endpoint=spread_endpoint) response = await client.alias.spread_parameter_with_inner_alias( id="str", diff --git a/packages/typespec-python/test/azure/generated/parameters-spread/generated_tests/test_spread_model_operations.py b/packages/typespec-python/test/azure/generated/parameters-spread/generated_tests/test_spread_model_operations.py index 26628cd2db0..e223de65762 100644 --- a/packages/typespec-python/test/azure/generated/parameters-spread/generated_tests/test_spread_model_operations.py +++ b/packages/typespec-python/test/azure/generated/parameters-spread/generated_tests/test_spread_model_operations.py @@ -14,7 +14,7 @@ class TestSpreadModelOperations(SpreadClientTestBase): @SpreadPreparer() @recorded_by_proxy - def test_spread_as_request_body(self, spread_endpoint): + def test_model_spread_as_request_body(self, spread_endpoint): client = self.create_client(endpoint=spread_endpoint) response = client.model.spread_as_request_body( body={"name": "str"}, @@ -26,7 +26,7 @@ def test_spread_as_request_body(self, spread_endpoint): @SpreadPreparer() @recorded_by_proxy - def test_spread_composite_request_only_with_body(self, spread_endpoint): + def test_model_spread_composite_request_only_with_body(self, spread_endpoint): client = self.create_client(endpoint=spread_endpoint) response = client.model.spread_composite_request_only_with_body( body={"name": "str"}, @@ -37,7 +37,7 @@ def test_spread_composite_request_only_with_body(self, spread_endpoint): @SpreadPreparer() @recorded_by_proxy - def test_spread_composite_request_without_body(self, spread_endpoint): + def test_model_spread_composite_request_without_body(self, spread_endpoint): client = self.create_client(endpoint=spread_endpoint) response = client.model.spread_composite_request_without_body( name="str", @@ -49,7 +49,7 @@ def test_spread_composite_request_without_body(self, spread_endpoint): @SpreadPreparer() @recorded_by_proxy - def test_spread_composite_request(self, spread_endpoint): + def test_model_spread_composite_request(self, spread_endpoint): client = self.create_client(endpoint=spread_endpoint) response = client.model.spread_composite_request( name="str", @@ -62,7 +62,7 @@ def test_spread_composite_request(self, spread_endpoint): @SpreadPreparer() @recorded_by_proxy - def test_spread_composite_request_mix(self, spread_endpoint): + def test_model_spread_composite_request_mix(self, spread_endpoint): client = self.create_client(endpoint=spread_endpoint) response = client.model.spread_composite_request_mix( name="str", diff --git a/packages/typespec-python/test/azure/generated/parameters-spread/generated_tests/test_spread_model_operations_async.py b/packages/typespec-python/test/azure/generated/parameters-spread/generated_tests/test_spread_model_operations_async.py index c384cc2c08f..d8919fbfd48 100644 --- a/packages/typespec-python/test/azure/generated/parameters-spread/generated_tests/test_spread_model_operations_async.py +++ b/packages/typespec-python/test/azure/generated/parameters-spread/generated_tests/test_spread_model_operations_async.py @@ -15,7 +15,7 @@ class TestSpreadModelOperationsAsync(SpreadClientTestBaseAsync): @SpreadPreparer() @recorded_by_proxy_async - async def test_spread_as_request_body(self, spread_endpoint): + async def test_model_spread_as_request_body(self, spread_endpoint): client = self.create_async_client(endpoint=spread_endpoint) response = await client.model.spread_as_request_body( body={"name": "str"}, @@ -27,7 +27,7 @@ async def test_spread_as_request_body(self, spread_endpoint): @SpreadPreparer() @recorded_by_proxy_async - async def test_spread_composite_request_only_with_body(self, spread_endpoint): + async def test_model_spread_composite_request_only_with_body(self, spread_endpoint): client = self.create_async_client(endpoint=spread_endpoint) response = await client.model.spread_composite_request_only_with_body( body={"name": "str"}, @@ -38,7 +38,7 @@ async def test_spread_composite_request_only_with_body(self, spread_endpoint): @SpreadPreparer() @recorded_by_proxy_async - async def test_spread_composite_request_without_body(self, spread_endpoint): + async def test_model_spread_composite_request_without_body(self, spread_endpoint): client = self.create_async_client(endpoint=spread_endpoint) response = await client.model.spread_composite_request_without_body( name="str", @@ -50,7 +50,7 @@ async def test_spread_composite_request_without_body(self, spread_endpoint): @SpreadPreparer() @recorded_by_proxy_async - async def test_spread_composite_request(self, spread_endpoint): + async def test_model_spread_composite_request(self, spread_endpoint): client = self.create_async_client(endpoint=spread_endpoint) response = await client.model.spread_composite_request( name="str", @@ -63,7 +63,7 @@ async def test_spread_composite_request(self, spread_endpoint): @SpreadPreparer() @recorded_by_proxy_async - async def test_spread_composite_request_mix(self, spread_endpoint): + async def test_model_spread_composite_request_mix(self, spread_endpoint): client = self.create_async_client(endpoint=spread_endpoint) response = await client.model.spread_composite_request_mix( name="str", diff --git a/packages/typespec-python/test/azure/generated/payload-content-negotiation/generated_tests/test_content_negotiation_different_body_operations.py b/packages/typespec-python/test/azure/generated/payload-content-negotiation/generated_tests/test_content_negotiation_different_body_operations.py index 7b93c7ee9f2..da9558d9c13 100644 --- a/packages/typespec-python/test/azure/generated/payload-content-negotiation/generated_tests/test_content_negotiation_different_body_operations.py +++ b/packages/typespec-python/test/azure/generated/payload-content-negotiation/generated_tests/test_content_negotiation_different_body_operations.py @@ -14,7 +14,7 @@ class TestContentNegotiationDifferentBodyOperations(ContentNegotiationClientTestBase): @ContentNegotiationPreparer() @recorded_by_proxy - def test_get_avatar_as_png(self, contentnegotiation_endpoint): + def test_different_body_get_avatar_as_png(self, contentnegotiation_endpoint): client = self.create_client(endpoint=contentnegotiation_endpoint) response = client.different_body.get_avatar_as_png( accept="image/png", @@ -25,7 +25,7 @@ def test_get_avatar_as_png(self, contentnegotiation_endpoint): @ContentNegotiationPreparer() @recorded_by_proxy - def test_get_avatar_as_json(self, contentnegotiation_endpoint): + def test_different_body_get_avatar_as_json(self, contentnegotiation_endpoint): client = self.create_client(endpoint=contentnegotiation_endpoint) response = client.different_body.get_avatar_as_json( accept="application/json", diff --git a/packages/typespec-python/test/azure/generated/payload-content-negotiation/generated_tests/test_content_negotiation_different_body_operations_async.py b/packages/typespec-python/test/azure/generated/payload-content-negotiation/generated_tests/test_content_negotiation_different_body_operations_async.py index f057a2087bb..62d47e75f10 100644 --- a/packages/typespec-python/test/azure/generated/payload-content-negotiation/generated_tests/test_content_negotiation_different_body_operations_async.py +++ b/packages/typespec-python/test/azure/generated/payload-content-negotiation/generated_tests/test_content_negotiation_different_body_operations_async.py @@ -15,7 +15,7 @@ class TestContentNegotiationDifferentBodyOperationsAsync(ContentNegotiationClientTestBaseAsync): @ContentNegotiationPreparer() @recorded_by_proxy_async - async def test_get_avatar_as_png(self, contentnegotiation_endpoint): + async def test_different_body_get_avatar_as_png(self, contentnegotiation_endpoint): client = self.create_async_client(endpoint=contentnegotiation_endpoint) response = await client.different_body.get_avatar_as_png( accept="image/png", @@ -26,7 +26,7 @@ async def test_get_avatar_as_png(self, contentnegotiation_endpoint): @ContentNegotiationPreparer() @recorded_by_proxy_async - async def test_get_avatar_as_json(self, contentnegotiation_endpoint): + async def test_different_body_get_avatar_as_json(self, contentnegotiation_endpoint): client = self.create_async_client(endpoint=contentnegotiation_endpoint) response = await client.different_body.get_avatar_as_json( accept="application/json", diff --git a/packages/typespec-python/test/azure/generated/payload-content-negotiation/generated_tests/test_content_negotiation_same_body_operations.py b/packages/typespec-python/test/azure/generated/payload-content-negotiation/generated_tests/test_content_negotiation_same_body_operations.py index d0378ead0f9..84186b5709d 100644 --- a/packages/typespec-python/test/azure/generated/payload-content-negotiation/generated_tests/test_content_negotiation_same_body_operations.py +++ b/packages/typespec-python/test/azure/generated/payload-content-negotiation/generated_tests/test_content_negotiation_same_body_operations.py @@ -14,7 +14,7 @@ class TestContentNegotiationSameBodyOperations(ContentNegotiationClientTestBase): @ContentNegotiationPreparer() @recorded_by_proxy - def test_get_avatar_as_png(self, contentnegotiation_endpoint): + def test_same_body_get_avatar_as_png(self, contentnegotiation_endpoint): client = self.create_client(endpoint=contentnegotiation_endpoint) response = client.same_body.get_avatar_as_png( accept="image/png", @@ -25,7 +25,7 @@ def test_get_avatar_as_png(self, contentnegotiation_endpoint): @ContentNegotiationPreparer() @recorded_by_proxy - def test_get_avatar_as_jpeg(self, contentnegotiation_endpoint): + def test_same_body_get_avatar_as_jpeg(self, contentnegotiation_endpoint): client = self.create_client(endpoint=contentnegotiation_endpoint) response = client.same_body.get_avatar_as_jpeg( accept="image/jpeg", diff --git a/packages/typespec-python/test/azure/generated/payload-content-negotiation/generated_tests/test_content_negotiation_same_body_operations_async.py b/packages/typespec-python/test/azure/generated/payload-content-negotiation/generated_tests/test_content_negotiation_same_body_operations_async.py index 296f8053442..2ece9daf85f 100644 --- a/packages/typespec-python/test/azure/generated/payload-content-negotiation/generated_tests/test_content_negotiation_same_body_operations_async.py +++ b/packages/typespec-python/test/azure/generated/payload-content-negotiation/generated_tests/test_content_negotiation_same_body_operations_async.py @@ -15,7 +15,7 @@ class TestContentNegotiationSameBodyOperationsAsync(ContentNegotiationClientTestBaseAsync): @ContentNegotiationPreparer() @recorded_by_proxy_async - async def test_get_avatar_as_png(self, contentnegotiation_endpoint): + async def test_same_body_get_avatar_as_png(self, contentnegotiation_endpoint): client = self.create_async_client(endpoint=contentnegotiation_endpoint) response = await client.same_body.get_avatar_as_png( accept="image/png", @@ -26,7 +26,7 @@ async def test_get_avatar_as_png(self, contentnegotiation_endpoint): @ContentNegotiationPreparer() @recorded_by_proxy_async - async def test_get_avatar_as_jpeg(self, contentnegotiation_endpoint): + async def test_same_body_get_avatar_as_jpeg(self, contentnegotiation_endpoint): client = self.create_async_client(endpoint=contentnegotiation_endpoint) response = await client.same_body.get_avatar_as_jpeg( accept="image/jpeg", diff --git a/packages/typespec-python/test/azure/generated/payload-media-type/generated_tests/test_media_type_string_body_operations.py b/packages/typespec-python/test/azure/generated/payload-media-type/generated_tests/test_media_type_string_body_operations.py index f8792bb548c..f3f77dafaf9 100644 --- a/packages/typespec-python/test/azure/generated/payload-media-type/generated_tests/test_media_type_string_body_operations.py +++ b/packages/typespec-python/test/azure/generated/payload-media-type/generated_tests/test_media_type_string_body_operations.py @@ -14,7 +14,7 @@ class TestMediaTypeStringBodyOperations(MediaTypeClientTestBase): @MediaTypePreparer() @recorded_by_proxy - def test_send_as_text(self, mediatype_endpoint): + def test_string_body_send_as_text(self, mediatype_endpoint): client = self.create_client(endpoint=mediatype_endpoint) response = client.string_body.send_as_text( text="str", @@ -26,7 +26,7 @@ def test_send_as_text(self, mediatype_endpoint): @MediaTypePreparer() @recorded_by_proxy - def test_get_as_text(self, mediatype_endpoint): + def test_string_body_get_as_text(self, mediatype_endpoint): client = self.create_client(endpoint=mediatype_endpoint) response = client.string_body.get_as_text() @@ -35,7 +35,7 @@ def test_get_as_text(self, mediatype_endpoint): @MediaTypePreparer() @recorded_by_proxy - def test_send_as_json(self, mediatype_endpoint): + def test_string_body_send_as_json(self, mediatype_endpoint): client = self.create_client(endpoint=mediatype_endpoint) response = client.string_body.send_as_json( text="str", @@ -47,7 +47,7 @@ def test_send_as_json(self, mediatype_endpoint): @MediaTypePreparer() @recorded_by_proxy - def test_get_as_json(self, mediatype_endpoint): + def test_string_body_get_as_json(self, mediatype_endpoint): client = self.create_client(endpoint=mediatype_endpoint) response = client.string_body.get_as_json() diff --git a/packages/typespec-python/test/azure/generated/payload-media-type/generated_tests/test_media_type_string_body_operations_async.py b/packages/typespec-python/test/azure/generated/payload-media-type/generated_tests/test_media_type_string_body_operations_async.py index efd590f043b..12547676b6f 100644 --- a/packages/typespec-python/test/azure/generated/payload-media-type/generated_tests/test_media_type_string_body_operations_async.py +++ b/packages/typespec-python/test/azure/generated/payload-media-type/generated_tests/test_media_type_string_body_operations_async.py @@ -15,7 +15,7 @@ class TestMediaTypeStringBodyOperationsAsync(MediaTypeClientTestBaseAsync): @MediaTypePreparer() @recorded_by_proxy_async - async def test_send_as_text(self, mediatype_endpoint): + async def test_string_body_send_as_text(self, mediatype_endpoint): client = self.create_async_client(endpoint=mediatype_endpoint) response = await client.string_body.send_as_text( text="str", @@ -27,7 +27,7 @@ async def test_send_as_text(self, mediatype_endpoint): @MediaTypePreparer() @recorded_by_proxy_async - async def test_get_as_text(self, mediatype_endpoint): + async def test_string_body_get_as_text(self, mediatype_endpoint): client = self.create_async_client(endpoint=mediatype_endpoint) response = await client.string_body.get_as_text() @@ -36,7 +36,7 @@ async def test_get_as_text(self, mediatype_endpoint): @MediaTypePreparer() @recorded_by_proxy_async - async def test_send_as_json(self, mediatype_endpoint): + async def test_string_body_send_as_json(self, mediatype_endpoint): client = self.create_async_client(endpoint=mediatype_endpoint) response = await client.string_body.send_as_json( text="str", @@ -48,7 +48,7 @@ async def test_send_as_json(self, mediatype_endpoint): @MediaTypePreparer() @recorded_by_proxy_async - async def test_get_as_json(self, mediatype_endpoint): + async def test_string_body_get_as_json(self, mediatype_endpoint): client = self.create_async_client(endpoint=mediatype_endpoint) response = await client.string_body.get_as_json() diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/apiview_mapping_python.json b/packages/typespec-python/test/azure/generated/payload-multipart/apiview_mapping_python.json index a8229c80f24..01e6180bb23 100644 --- a/packages/typespec-python/test/azure/generated/payload-multipart/apiview_mapping_python.json +++ b/packages/typespec-python/test/azure/generated/payload-multipart/apiview_mapping_python.json @@ -8,19 +8,16 @@ "payload.multipart.models.FileWithHttpPartOptionalContentTypeRequest": "Payload.MultiPart.FileWithHttpPartOptionalContentTypeRequest", "payload.multipart.models.FileWithHttpPartRequiredContentTypeRequest": "Payload.MultiPart.FileWithHttpPartRequiredContentTypeRequest", "payload.multipart.models.FileWithHttpPartSpecificContentTypeRequest": "Payload.MultiPart.FileWithHttpPartSpecificContentTypeRequest", + "payload.multipart.models.FloatRequest": "Payload.MultiPart.FormData.HttpParts.NonString.float.Request.anonymous", "payload.multipart.models.JsonPartRequest": "Payload.MultiPart.JsonPartRequest", "payload.multipart.models.MultiBinaryPartsRequest": "Payload.MultiPart.MultiBinaryPartsRequest", "payload.multipart.models.MultiPartRequest": "Payload.MultiPart.MultiPartRequest", "payload.multipart.MultiPartClient.form_data.basic": "Payload.MultiPart.FormData.basic", - "payload.multipart.MultiPartClient.form_data.complex": "Payload.MultiPart.FormData.complex", + "payload.multipart.MultiPartClient.form_data.file_array_and_basic": "Payload.MultiPart.FormData.fileArrayAndBasic", "payload.multipart.MultiPartClient.form_data.json_part": "Payload.MultiPart.FormData.jsonPart", "payload.multipart.MultiPartClient.form_data.binary_array_parts": "Payload.MultiPart.FormData.binaryArrayParts", "payload.multipart.MultiPartClient.form_data.multi_binary_parts": "Payload.MultiPart.FormData.multiBinaryParts", "payload.multipart.MultiPartClient.form_data.check_file_name_and_content_type": "Payload.MultiPart.FormData.checkFileNameAndContentType", - "payload.multipart.MultiPartClient.form_data.anonymous_model": "Payload.MultiPart.FormData.anonymousModel", - "payload.multipart.MultiPartClient.form_data.file_with_http_part_specific_content_type": "Payload.MultiPart.FormData.fileWithHttpPartSpecificContentType", - "payload.multipart.MultiPartClient.form_data.file_with_http_part_required_content_type": "Payload.MultiPart.FormData.fileWithHttpPartRequiredContentType", - "payload.multipart.MultiPartClient.form_data.file_with_http_part_optional_content_type": "Payload.MultiPart.FormData.fileWithHttpPartOptionalContentType", - "payload.multipart.MultiPartClient.form_data.complex_with_http_part": "Payload.MultiPart.FormData.complexWithHttpPart" + "payload.multipart.MultiPartClient.form_data.anonymous_model": "Payload.MultiPart.FormData.anonymousModel" } } \ No newline at end of file diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/generated_tests/test_multi_part_form_data_operations.py b/packages/typespec-python/test/azure/generated/payload-multipart/generated_tests/test_multi_part_form_data_operations.py index f61a7f8c1d4..c0787c2ae85 100644 --- a/packages/typespec-python/test/azure/generated/payload-multipart/generated_tests/test_multi_part_form_data_operations.py +++ b/packages/typespec-python/test/azure/generated/payload-multipart/generated_tests/test_multi_part_form_data_operations.py @@ -14,7 +14,7 @@ class TestMultiPartFormDataOperations(MultiPartClientTestBase): @MultiPartPreparer() @recorded_by_proxy - def test_basic(self, multipart_endpoint): + def test_form_data_basic(self, multipart_endpoint): client = self.create_client(endpoint=multipart_endpoint) response = client.form_data.basic( body={"id": "str", "profileImage": "filetype"}, @@ -25,9 +25,9 @@ def test_basic(self, multipart_endpoint): @MultiPartPreparer() @recorded_by_proxy - def test_complex(self, multipart_endpoint): + def test_form_data_file_array_and_basic(self, multipart_endpoint): client = self.create_client(endpoint=multipart_endpoint) - response = client.form_data.complex( + response = client.form_data.file_array_and_basic( body={"address": {"city": "str"}, "id": "str", "pictures": ["filetype"], "profileImage": "filetype"}, ) @@ -36,7 +36,7 @@ def test_complex(self, multipart_endpoint): @MultiPartPreparer() @recorded_by_proxy - def test_json_part(self, multipart_endpoint): + def test_form_data_json_part(self, multipart_endpoint): client = self.create_client(endpoint=multipart_endpoint) response = client.form_data.json_part( body={"address": {"city": "str"}, "profileImage": "filetype"}, @@ -47,7 +47,7 @@ def test_json_part(self, multipart_endpoint): @MultiPartPreparer() @recorded_by_proxy - def test_binary_array_parts(self, multipart_endpoint): + def test_form_data_binary_array_parts(self, multipart_endpoint): client = self.create_client(endpoint=multipart_endpoint) response = client.form_data.binary_array_parts( body={"id": "str", "pictures": ["filetype"]}, @@ -58,7 +58,7 @@ def test_binary_array_parts(self, multipart_endpoint): @MultiPartPreparer() @recorded_by_proxy - def test_multi_binary_parts(self, multipart_endpoint): + def test_form_data_multi_binary_parts(self, multipart_endpoint): client = self.create_client(endpoint=multipart_endpoint) response = client.form_data.multi_binary_parts( body={"profileImage": "filetype", "picture": "filetype"}, @@ -69,7 +69,7 @@ def test_multi_binary_parts(self, multipart_endpoint): @MultiPartPreparer() @recorded_by_proxy - def test_check_file_name_and_content_type(self, multipart_endpoint): + def test_form_data_check_file_name_and_content_type(self, multipart_endpoint): client = self.create_client(endpoint=multipart_endpoint) response = client.form_data.check_file_name_and_content_type( body={"id": "str", "profileImage": "filetype"}, @@ -80,7 +80,7 @@ def test_check_file_name_and_content_type(self, multipart_endpoint): @MultiPartPreparer() @recorded_by_proxy - def test_anonymous_model(self, multipart_endpoint): + def test_form_data_anonymous_model(self, multipart_endpoint): client = self.create_client(endpoint=multipart_endpoint) response = client.form_data.anonymous_model( body={"profileImage": "filetype"}, @@ -92,9 +92,26 @@ def test_anonymous_model(self, multipart_endpoint): @MultiPartPreparer() @recorded_by_proxy - def test_file_with_http_part_specific_content_type(self, multipart_endpoint): + def test_form_data_http_parts_json_array_and_file_array(self, multipart_endpoint): client = self.create_client(endpoint=multipart_endpoint) - response = client.form_data.file_with_http_part_specific_content_type( + response = client.form_data.http_parts.json_array_and_file_array( + body={ + "address": {"city": "str"}, + "id": "str", + "pictures": ["filetype"], + "previousAddresses": [{"city": "str"}], + "profileImage": "filetype", + }, + ) + + # please add some check logic here by yourself + # ... + + @MultiPartPreparer() + @recorded_by_proxy + def test_form_data_http_parts_content_type_image_jpeg_content_type(self, multipart_endpoint): + client = self.create_client(endpoint=multipart_endpoint) + response = client.form_data.http_parts.content_type.image_jpeg_content_type( body={"profileImage": "filetype"}, ) @@ -103,9 +120,9 @@ def test_file_with_http_part_specific_content_type(self, multipart_endpoint): @MultiPartPreparer() @recorded_by_proxy - def test_file_with_http_part_required_content_type(self, multipart_endpoint): + def test_form_data_http_parts_content_type_required_content_type(self, multipart_endpoint): client = self.create_client(endpoint=multipart_endpoint) - response = client.form_data.file_with_http_part_required_content_type( + response = client.form_data.http_parts.content_type.required_content_type( body={"profileImage": "filetype"}, ) @@ -114,9 +131,9 @@ def test_file_with_http_part_required_content_type(self, multipart_endpoint): @MultiPartPreparer() @recorded_by_proxy - def test_file_with_http_part_optional_content_type(self, multipart_endpoint): + def test_form_data_http_parts_content_type_optional_content_type(self, multipart_endpoint): client = self.create_client(endpoint=multipart_endpoint) - response = client.form_data.file_with_http_part_optional_content_type( + response = client.form_data.http_parts.content_type.optional_content_type( body={"profileImage": "filetype"}, ) @@ -125,16 +142,10 @@ def test_file_with_http_part_optional_content_type(self, multipart_endpoint): @MultiPartPreparer() @recorded_by_proxy - def test_complex_with_http_part(self, multipart_endpoint): + def test_form_data_http_parts_non_string_float(self, multipart_endpoint): client = self.create_client(endpoint=multipart_endpoint) - response = client.form_data.complex_with_http_part( - body={ - "address": {"city": "str"}, - "id": "str", - "pictures": ["filetype"], - "previousAddresses": [{"city": "str"}], - "profileImage": "filetype", - }, + response = client.form_data.http_parts.non_string.float( + body={"temperature": 0.0}, ) # please add some check logic here by yourself diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/generated_tests/test_multi_part_form_data_operations_async.py b/packages/typespec-python/test/azure/generated/payload-multipart/generated_tests/test_multi_part_form_data_operations_async.py index a72fd83a3ec..e030fa8600a 100644 --- a/packages/typespec-python/test/azure/generated/payload-multipart/generated_tests/test_multi_part_form_data_operations_async.py +++ b/packages/typespec-python/test/azure/generated/payload-multipart/generated_tests/test_multi_part_form_data_operations_async.py @@ -15,7 +15,7 @@ class TestMultiPartFormDataOperationsAsync(MultiPartClientTestBaseAsync): @MultiPartPreparer() @recorded_by_proxy_async - async def test_basic(self, multipart_endpoint): + async def test_form_data_basic(self, multipart_endpoint): client = self.create_async_client(endpoint=multipart_endpoint) response = await client.form_data.basic( body={"id": "str", "profileImage": "filetype"}, @@ -26,9 +26,9 @@ async def test_basic(self, multipart_endpoint): @MultiPartPreparer() @recorded_by_proxy_async - async def test_complex(self, multipart_endpoint): + async def test_form_data_file_array_and_basic(self, multipart_endpoint): client = self.create_async_client(endpoint=multipart_endpoint) - response = await client.form_data.complex( + response = await client.form_data.file_array_and_basic( body={"address": {"city": "str"}, "id": "str", "pictures": ["filetype"], "profileImage": "filetype"}, ) @@ -37,7 +37,7 @@ async def test_complex(self, multipart_endpoint): @MultiPartPreparer() @recorded_by_proxy_async - async def test_json_part(self, multipart_endpoint): + async def test_form_data_json_part(self, multipart_endpoint): client = self.create_async_client(endpoint=multipart_endpoint) response = await client.form_data.json_part( body={"address": {"city": "str"}, "profileImage": "filetype"}, @@ -48,7 +48,7 @@ async def test_json_part(self, multipart_endpoint): @MultiPartPreparer() @recorded_by_proxy_async - async def test_binary_array_parts(self, multipart_endpoint): + async def test_form_data_binary_array_parts(self, multipart_endpoint): client = self.create_async_client(endpoint=multipart_endpoint) response = await client.form_data.binary_array_parts( body={"id": "str", "pictures": ["filetype"]}, @@ -59,7 +59,7 @@ async def test_binary_array_parts(self, multipart_endpoint): @MultiPartPreparer() @recorded_by_proxy_async - async def test_multi_binary_parts(self, multipart_endpoint): + async def test_form_data_multi_binary_parts(self, multipart_endpoint): client = self.create_async_client(endpoint=multipart_endpoint) response = await client.form_data.multi_binary_parts( body={"profileImage": "filetype", "picture": "filetype"}, @@ -70,7 +70,7 @@ async def test_multi_binary_parts(self, multipart_endpoint): @MultiPartPreparer() @recorded_by_proxy_async - async def test_check_file_name_and_content_type(self, multipart_endpoint): + async def test_form_data_check_file_name_and_content_type(self, multipart_endpoint): client = self.create_async_client(endpoint=multipart_endpoint) response = await client.form_data.check_file_name_and_content_type( body={"id": "str", "profileImage": "filetype"}, @@ -81,7 +81,7 @@ async def test_check_file_name_and_content_type(self, multipart_endpoint): @MultiPartPreparer() @recorded_by_proxy_async - async def test_anonymous_model(self, multipart_endpoint): + async def test_form_data_anonymous_model(self, multipart_endpoint): client = self.create_async_client(endpoint=multipart_endpoint) response = await client.form_data.anonymous_model( body={"profileImage": "filetype"}, @@ -93,9 +93,26 @@ async def test_anonymous_model(self, multipart_endpoint): @MultiPartPreparer() @recorded_by_proxy_async - async def test_file_with_http_part_specific_content_type(self, multipart_endpoint): + async def test_form_data_http_parts_json_array_and_file_array(self, multipart_endpoint): client = self.create_async_client(endpoint=multipart_endpoint) - response = await client.form_data.file_with_http_part_specific_content_type( + response = await client.form_data.http_parts.json_array_and_file_array( + body={ + "address": {"city": "str"}, + "id": "str", + "pictures": ["filetype"], + "previousAddresses": [{"city": "str"}], + "profileImage": "filetype", + }, + ) + + # please add some check logic here by yourself + # ... + + @MultiPartPreparer() + @recorded_by_proxy_async + async def test_form_data_http_parts_content_type_image_jpeg_content_type(self, multipart_endpoint): + client = self.create_async_client(endpoint=multipart_endpoint) + response = await client.form_data.http_parts.content_type.image_jpeg_content_type( body={"profileImage": "filetype"}, ) @@ -104,9 +121,9 @@ async def test_file_with_http_part_specific_content_type(self, multipart_endpoin @MultiPartPreparer() @recorded_by_proxy_async - async def test_file_with_http_part_required_content_type(self, multipart_endpoint): + async def test_form_data_http_parts_content_type_required_content_type(self, multipart_endpoint): client = self.create_async_client(endpoint=multipart_endpoint) - response = await client.form_data.file_with_http_part_required_content_type( + response = await client.form_data.http_parts.content_type.required_content_type( body={"profileImage": "filetype"}, ) @@ -115,9 +132,9 @@ async def test_file_with_http_part_required_content_type(self, multipart_endpoin @MultiPartPreparer() @recorded_by_proxy_async - async def test_file_with_http_part_optional_content_type(self, multipart_endpoint): + async def test_form_data_http_parts_content_type_optional_content_type(self, multipart_endpoint): client = self.create_async_client(endpoint=multipart_endpoint) - response = await client.form_data.file_with_http_part_optional_content_type( + response = await client.form_data.http_parts.content_type.optional_content_type( body={"profileImage": "filetype"}, ) @@ -126,16 +143,10 @@ async def test_file_with_http_part_optional_content_type(self, multipart_endpoin @MultiPartPreparer() @recorded_by_proxy_async - async def test_complex_with_http_part(self, multipart_endpoint): + async def test_form_data_http_parts_non_string_float(self, multipart_endpoint): client = self.create_async_client(endpoint=multipart_endpoint) - response = await client.form_data.complex_with_http_part( - body={ - "address": {"city": "str"}, - "id": "str", - "pictures": ["filetype"], - "previousAddresses": [{"city": "str"}], - "profileImage": "filetype", - }, + response = await client.form_data.http_parts.non_string.float( + body={"temperature": 0.0}, ) # please add some check logic here by yourself diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/aio/operations/_operations.py index f95a7e93f8c..3736e623133 100644 --- a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/aio/operations/_operations.py @@ -28,11 +28,12 @@ build_form_data_basic_request, build_form_data_binary_array_parts_request, build_form_data_check_file_name_and_content_type_request, - build_form_data_complex_request, - build_form_data_complex_with_http_part_request, - build_form_data_file_with_http_part_optional_content_type_request, - build_form_data_file_with_http_part_required_content_type_request, - build_form_data_file_with_http_part_specific_content_type_request, + build_form_data_file_array_and_basic_request, + build_form_data_http_parts_content_type_image_jpeg_content_type_request, + build_form_data_http_parts_content_type_optional_content_type_request, + build_form_data_http_parts_content_type_required_content_type_request, + build_form_data_http_parts_json_array_and_file_array_request, + build_form_data_http_parts_non_string_float_request, build_form_data_json_part_request, build_form_data_multi_binary_parts_request, ) @@ -64,6 +65,8 @@ def __init__(self, *args, **kwargs) -> None: self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self.http_parts = FormDataHttpPartsOperations(self._client, self._config, self._serialize, self._deserialize) + @overload async def basic( # pylint: disable=inconsistent-return-statements self, body: _models.MultiPartRequest, **kwargs: Any @@ -144,7 +147,7 @@ async def basic( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @overload - async def complex( # pylint: disable=inconsistent-return-statements + async def file_array_and_basic( # pylint: disable=inconsistent-return-statements self, body: _models.ComplexPartsRequest, **kwargs: Any ) -> None: """Test content-type: multipart/form-data for mixed scenarios. @@ -157,7 +160,9 @@ async def complex( # pylint: disable=inconsistent-return-statements """ @overload - async def complex(self, body: JSON, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + async def file_array_and_basic( # pylint: disable=inconsistent-return-statements + self, body: JSON, **kwargs: Any + ) -> None: """Test content-type: multipart/form-data for mixed scenarios. :param body: Required. @@ -168,7 +173,7 @@ async def complex(self, body: JSON, **kwargs: Any) -> None: # pylint: disable=i """ @distributed_trace_async - async def complex( # pylint: disable=inconsistent-return-statements + async def file_array_and_basic( # pylint: disable=inconsistent-return-statements self, body: Union[_models.ComplexPartsRequest, JSON], **kwargs: Any ) -> None: """Test content-type: multipart/form-data for mixed scenarios. @@ -197,7 +202,7 @@ async def complex( # pylint: disable=inconsistent-return-statements _data_fields: List[str] = ["id", "address"] _files, _data = prepare_multipart_form_data(_body, _file_fields, _data_fields) - _request = build_form_data_complex_request( + _request = build_form_data_file_array_and_basic_request( files=_files, data=_data, headers=_headers, @@ -632,8 +637,132 @@ async def anonymous_model( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) # type: ignore + +class FormDataHttpPartsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~payload.multipart.aio.MultiPartClient`'s + :attr:`http_parts` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + self.content_type = FormDataHttpPartsContentTypeOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.non_string = FormDataHttpPartsNonStringOperations( + self._client, self._config, self._serialize, self._deserialize + ) + + @overload + async def json_array_and_file_array( # pylint: disable=inconsistent-return-statements + self, body: _models.ComplexHttpPartsModelRequest, **kwargs: Any + ) -> None: + """Test content-type: multipart/form-data for mixed scenarios. + + :param body: Required. + :type body: ~payload.multipart.models.ComplexHttpPartsModelRequest + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + @overload - async def file_with_http_part_specific_content_type( # pylint: disable=inconsistent-return-statements,name-too-long + async def json_array_and_file_array( # pylint: disable=inconsistent-return-statements + self, body: JSON, **kwargs: Any + ) -> None: + """Test content-type: multipart/form-data for mixed scenarios. + + :param body: Required. + :type body: JSON + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def json_array_and_file_array( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.ComplexHttpPartsModelRequest, JSON], **kwargs: Any + ) -> None: + """Test content-type: multipart/form-data for mixed scenarios. + + :param body: Is either a ComplexHttpPartsModelRequest type or a JSON type. Required. + :type body: ~payload.multipart.models.ComplexHttpPartsModelRequest or JSON + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _body = body.as_dict() if isinstance(body, _model_base.Model) else body + _file_fields: List[str] = ["profileImage", "pictures"] + _data_fields: List[str] = ["id", "address", "previousAddresses"] + _files, _data = prepare_multipart_form_data(_body, _file_fields, _data_fields) + + _request = build_form_data_http_parts_json_array_and_file_array_request( + files=_files, + data=_data, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class FormDataHttpPartsContentTypeOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~payload.multipart.aio.MultiPartClient`'s + :attr:`content_type` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @overload + async def image_jpeg_content_type( # pylint: disable=inconsistent-return-statements self, body: _models.FileWithHttpPartSpecificContentTypeRequest, **kwargs: Any ) -> None: """Test content-type: multipart/form-data. @@ -646,7 +775,7 @@ async def file_with_http_part_specific_content_type( # pylint: disable=inconsis """ @overload - async def file_with_http_part_specific_content_type( # pylint: disable=inconsistent-return-statements,name-too-long + async def image_jpeg_content_type( # pylint: disable=inconsistent-return-statements self, body: JSON, **kwargs: Any ) -> None: """Test content-type: multipart/form-data. @@ -659,7 +788,7 @@ async def file_with_http_part_specific_content_type( # pylint: disable=inconsis """ @distributed_trace_async - async def file_with_http_part_specific_content_type( # pylint: disable=inconsistent-return-statements,name-too-long + async def image_jpeg_content_type( # pylint: disable=inconsistent-return-statements self, body: Union[_models.FileWithHttpPartSpecificContentTypeRequest, JSON], **kwargs: Any ) -> None: """Test content-type: multipart/form-data. @@ -689,7 +818,7 @@ async def file_with_http_part_specific_content_type( # pylint: disable=inconsis _data_fields: List[str] = [] _files, _data = prepare_multipart_form_data(_body, _file_fields, _data_fields) - _request = build_form_data_file_with_http_part_specific_content_type_request( + _request = build_form_data_http_parts_content_type_image_jpeg_content_type_request( files=_files, data=_data, headers=_headers, @@ -715,7 +844,7 @@ async def file_with_http_part_specific_content_type( # pylint: disable=inconsis return cls(pipeline_response, None, {}) # type: ignore @overload - async def file_with_http_part_required_content_type( # pylint: disable=inconsistent-return-statements,name-too-long + async def required_content_type( # pylint: disable=inconsistent-return-statements self, body: _models.FileWithHttpPartRequiredContentTypeRequest, **kwargs: Any ) -> None: """Test content-type: multipart/form-data. @@ -728,7 +857,7 @@ async def file_with_http_part_required_content_type( # pylint: disable=inconsis """ @overload - async def file_with_http_part_required_content_type( # pylint: disable=inconsistent-return-statements,name-too-long + async def required_content_type( # pylint: disable=inconsistent-return-statements self, body: JSON, **kwargs: Any ) -> None: """Test content-type: multipart/form-data. @@ -741,7 +870,7 @@ async def file_with_http_part_required_content_type( # pylint: disable=inconsis """ @distributed_trace_async - async def file_with_http_part_required_content_type( # pylint: disable=inconsistent-return-statements,name-too-long + async def required_content_type( # pylint: disable=inconsistent-return-statements self, body: Union[_models.FileWithHttpPartRequiredContentTypeRequest, JSON], **kwargs: Any ) -> None: """Test content-type: multipart/form-data. @@ -771,7 +900,7 @@ async def file_with_http_part_required_content_type( # pylint: disable=inconsis _data_fields: List[str] = [] _files, _data = prepare_multipart_form_data(_body, _file_fields, _data_fields) - _request = build_form_data_file_with_http_part_required_content_type_request( + _request = build_form_data_http_parts_content_type_required_content_type_request( files=_files, data=_data, headers=_headers, @@ -797,7 +926,7 @@ async def file_with_http_part_required_content_type( # pylint: disable=inconsis return cls(pipeline_response, None, {}) # type: ignore @overload - async def file_with_http_part_optional_content_type( # pylint: disable=inconsistent-return-statements,name-too-long + async def optional_content_type( # pylint: disable=inconsistent-return-statements self, body: _models.FileWithHttpPartOptionalContentTypeRequest, **kwargs: Any ) -> None: """Test content-type: multipart/form-data for optional content type. @@ -810,7 +939,7 @@ async def file_with_http_part_optional_content_type( # pylint: disable=inconsis """ @overload - async def file_with_http_part_optional_content_type( # pylint: disable=inconsistent-return-statements,name-too-long + async def optional_content_type( # pylint: disable=inconsistent-return-statements self, body: JSON, **kwargs: Any ) -> None: """Test content-type: multipart/form-data for optional content type. @@ -823,7 +952,7 @@ async def file_with_http_part_optional_content_type( # pylint: disable=inconsis """ @distributed_trace_async - async def file_with_http_part_optional_content_type( # pylint: disable=inconsistent-return-statements,name-too-long + async def optional_content_type( # pylint: disable=inconsistent-return-statements self, body: Union[_models.FileWithHttpPartOptionalContentTypeRequest, JSON], **kwargs: Any ) -> None: """Test content-type: multipart/form-data for optional content type. @@ -853,7 +982,7 @@ async def file_with_http_part_optional_content_type( # pylint: disable=inconsis _data_fields: List[str] = [] _files, _data = prepare_multipart_form_data(_body, _file_fields, _data_fields) - _request = build_form_data_file_with_http_part_optional_content_type_request( + _request = build_form_data_http_parts_content_type_optional_content_type_request( files=_files, data=_data, headers=_headers, @@ -878,24 +1007,40 @@ async def file_with_http_part_optional_content_type( # pylint: disable=inconsis if cls: return cls(pipeline_response, None, {}) # type: ignore + +class FormDataHttpPartsNonStringOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~payload.multipart.aio.MultiPartClient`'s + :attr:`non_string` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @overload - async def complex_with_http_part( # pylint: disable=inconsistent-return-statements - self, body: _models.ComplexHttpPartsModelRequest, **kwargs: Any + async def float( # pylint: disable=inconsistent-return-statements + self, body: _models.FloatRequest, **kwargs: Any ) -> None: - """Test content-type: multipart/form-data for mixed scenarios. + """Test content-type: multipart/form-data for non string. :param body: Required. - :type body: ~payload.multipart.models.ComplexHttpPartsModelRequest + :type body: ~payload.multipart.models.FloatRequest :return: None :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def complex_with_http_part( # pylint: disable=inconsistent-return-statements - self, body: JSON, **kwargs: Any - ) -> None: - """Test content-type: multipart/form-data for mixed scenarios. + async def float(self, body: JSON, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """Test content-type: multipart/form-data for non string. :param body: Required. :type body: JSON @@ -905,13 +1050,13 @@ async def complex_with_http_part( # pylint: disable=inconsistent-return-stateme """ @distributed_trace_async - async def complex_with_http_part( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.ComplexHttpPartsModelRequest, JSON], **kwargs: Any + async def float( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.FloatRequest, JSON], **kwargs: Any ) -> None: - """Test content-type: multipart/form-data for mixed scenarios. + """Test content-type: multipart/form-data for non string. - :param body: Is either a ComplexHttpPartsModelRequest type or a JSON type. Required. - :type body: ~payload.multipart.models.ComplexHttpPartsModelRequest or JSON + :param body: Is either a FloatRequest type or a JSON type. Required. + :type body: ~payload.multipart.models.FloatRequest or JSON :return: None :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -930,11 +1075,11 @@ async def complex_with_http_part( # pylint: disable=inconsistent-return-stateme cls: ClsType[None] = kwargs.pop("cls", None) _body = body.as_dict() if isinstance(body, _model_base.Model) else body - _file_fields: List[str] = ["profileImage", "pictures"] - _data_fields: List[str] = ["id", "address", "previousAddresses"] + _file_fields: List[str] = [] + _data_fields: List[str] = ["temperature"] _files, _data = prepare_multipart_form_data(_body, _file_fields, _data_fields) - _request = build_form_data_complex_with_http_part_request( + _request = build_form_data_http_parts_non_string_float_request( files=_files, data=_data, headers=_headers, diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/models/__init__.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/models/__init__.py index 8b8c29a7acf..a4cd50bf899 100644 --- a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/models/__init__.py +++ b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/models/__init__.py @@ -13,6 +13,7 @@ from ._models import FileWithHttpPartOptionalContentTypeRequest from ._models import FileWithHttpPartRequiredContentTypeRequest from ._models import FileWithHttpPartSpecificContentTypeRequest +from ._models import FloatRequest from ._models import JsonPartRequest from ._models import MultiBinaryPartsRequest from ._models import MultiPartRequest @@ -28,6 +29,7 @@ "FileWithHttpPartOptionalContentTypeRequest", "FileWithHttpPartRequiredContentTypeRequest", "FileWithHttpPartSpecificContentTypeRequest", + "FloatRequest", "JsonPartRequest", "MultiBinaryPartsRequest", "MultiPartRequest", diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/models/_models.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/models/_models.py index e4417befc5b..fd7c8e463af 100644 --- a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/models/_models.py +++ b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/models/_models.py @@ -268,6 +268,36 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useles super().__init__(*args, **kwargs) +class FloatRequest(_model_base.Model): + """FloatRequest. + + All required parameters must be populated in order to send to server. + + :ivar temperature: Required. + :vartype temperature: float + """ + + temperature: float = rest_field() + """Required.""" + + @overload + def __init__( + self, + *, + temperature: float, + ): ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + + class JsonPartRequest(_model_base.Model): """JsonPartRequest. diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/operations/_operations.py b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/operations/_operations.py index d5fd5b421d4..4460f1fe4c7 100644 --- a/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/payload-multipart/payload/multipart/operations/_operations.py @@ -48,7 +48,7 @@ def build_form_data_basic_request(**kwargs: Any) -> HttpRequest: return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) -def build_form_data_complex_request(**kwargs: Any) -> HttpRequest: +def build_form_data_file_array_and_basic_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) # Construct URL @@ -104,7 +104,18 @@ def build_form_data_anonymous_model_request(**kwargs: Any) -> HttpRequest: return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) -def build_form_data_file_with_http_part_specific_content_type_request( # pylint: disable=name-too-long +def build_form_data_http_parts_json_array_and_file_array_request( # pylint: disable=name-too-long + **kwargs: Any, +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + # Construct URL + _url = "/multipart/form-data/complex-parts-with-httppart" + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_form_data_http_parts_content_type_image_jpeg_content_type_request( # pylint: disable=name-too-long **kwargs: Any, ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -115,7 +126,7 @@ def build_form_data_file_with_http_part_specific_content_type_request( # pylint return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) -def build_form_data_file_with_http_part_required_content_type_request( # pylint: disable=name-too-long +def build_form_data_http_parts_content_type_required_content_type_request( # pylint: disable=name-too-long **kwargs: Any, ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -126,7 +137,7 @@ def build_form_data_file_with_http_part_required_content_type_request( # pylint return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) -def build_form_data_file_with_http_part_optional_content_type_request( # pylint: disable=name-too-long +def build_form_data_http_parts_content_type_optional_content_type_request( # pylint: disable=name-too-long **kwargs: Any, ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -137,11 +148,11 @@ def build_form_data_file_with_http_part_optional_content_type_request( # pylint return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) -def build_form_data_complex_with_http_part_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long +def build_form_data_http_parts_non_string_float_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) # Construct URL - _url = "/multipart/form-data/complex-parts-with-httppart" + _url = "/multipart/form-data/non-string-float" return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) @@ -163,6 +174,8 @@ def __init__(self, *args, **kwargs): self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self.http_parts = FormDataHttpPartsOperations(self._client, self._config, self._serialize, self._deserialize) + @overload def basic( # pylint: disable=inconsistent-return-statements self, body: _models.MultiPartRequest, **kwargs: Any @@ -243,7 +256,7 @@ def basic( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @overload - def complex( # pylint: disable=inconsistent-return-statements + def file_array_and_basic( # pylint: disable=inconsistent-return-statements self, body: _models.ComplexPartsRequest, **kwargs: Any ) -> None: """Test content-type: multipart/form-data for mixed scenarios. @@ -256,7 +269,7 @@ def complex( # pylint: disable=inconsistent-return-statements """ @overload - def complex(self, body: JSON, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + def file_array_and_basic(self, body: JSON, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements """Test content-type: multipart/form-data for mixed scenarios. :param body: Required. @@ -267,7 +280,7 @@ def complex(self, body: JSON, **kwargs: Any) -> None: # pylint: disable=inconsi """ @distributed_trace - def complex( # pylint: disable=inconsistent-return-statements + def file_array_and_basic( # pylint: disable=inconsistent-return-statements self, body: Union[_models.ComplexPartsRequest, JSON], **kwargs: Any ) -> None: """Test content-type: multipart/form-data for mixed scenarios. @@ -296,7 +309,7 @@ def complex( # pylint: disable=inconsistent-return-statements _data_fields: List[str] = ["id", "address"] _files, _data = prepare_multipart_form_data(_body, _file_fields, _data_fields) - _request = build_form_data_complex_request( + _request = build_form_data_file_array_and_basic_request( files=_files, data=_data, headers=_headers, @@ -725,8 +738,132 @@ def anonymous_model( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) # type: ignore + +class FormDataHttpPartsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~payload.multipart.MultiPartClient`'s + :attr:`http_parts` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + self.content_type = FormDataHttpPartsContentTypeOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.non_string = FormDataHttpPartsNonStringOperations( + self._client, self._config, self._serialize, self._deserialize + ) + + @overload + def json_array_and_file_array( # pylint: disable=inconsistent-return-statements + self, body: _models.ComplexHttpPartsModelRequest, **kwargs: Any + ) -> None: + """Test content-type: multipart/form-data for mixed scenarios. + + :param body: Required. + :type body: ~payload.multipart.models.ComplexHttpPartsModelRequest + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def json_array_and_file_array( # pylint: disable=inconsistent-return-statements + self, body: JSON, **kwargs: Any + ) -> None: + """Test content-type: multipart/form-data for mixed scenarios. + + :param body: Required. + :type body: JSON + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def json_array_and_file_array( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.ComplexHttpPartsModelRequest, JSON], **kwargs: Any + ) -> None: + """Test content-type: multipart/form-data for mixed scenarios. + + :param body: Is either a ComplexHttpPartsModelRequest type or a JSON type. Required. + :type body: ~payload.multipart.models.ComplexHttpPartsModelRequest or JSON + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _body = body.as_dict() if isinstance(body, _model_base.Model) else body + _file_fields: List[str] = ["profileImage", "pictures"] + _data_fields: List[str] = ["id", "address", "previousAddresses"] + _files, _data = prepare_multipart_form_data(_body, _file_fields, _data_fields) + + _request = build_form_data_http_parts_json_array_and_file_array_request( + files=_files, + data=_data, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class FormDataHttpPartsContentTypeOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~payload.multipart.MultiPartClient`'s + :attr:`content_type` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @overload - def file_with_http_part_specific_content_type( # pylint: disable=inconsistent-return-statements,name-too-long + def image_jpeg_content_type( # pylint: disable=inconsistent-return-statements self, body: _models.FileWithHttpPartSpecificContentTypeRequest, **kwargs: Any ) -> None: """Test content-type: multipart/form-data. @@ -739,7 +876,7 @@ def file_with_http_part_specific_content_type( # pylint: disable=inconsistent-r """ @overload - def file_with_http_part_specific_content_type( # pylint: disable=inconsistent-return-statements,name-too-long + def image_jpeg_content_type( # pylint: disable=inconsistent-return-statements self, body: JSON, **kwargs: Any ) -> None: """Test content-type: multipart/form-data. @@ -752,7 +889,7 @@ def file_with_http_part_specific_content_type( # pylint: disable=inconsistent-r """ @distributed_trace - def file_with_http_part_specific_content_type( # pylint: disable=inconsistent-return-statements,name-too-long + def image_jpeg_content_type( # pylint: disable=inconsistent-return-statements self, body: Union[_models.FileWithHttpPartSpecificContentTypeRequest, JSON], **kwargs: Any ) -> None: """Test content-type: multipart/form-data. @@ -782,7 +919,7 @@ def file_with_http_part_specific_content_type( # pylint: disable=inconsistent-r _data_fields: List[str] = [] _files, _data = prepare_multipart_form_data(_body, _file_fields, _data_fields) - _request = build_form_data_file_with_http_part_specific_content_type_request( + _request = build_form_data_http_parts_content_type_image_jpeg_content_type_request( files=_files, data=_data, headers=_headers, @@ -808,7 +945,7 @@ def file_with_http_part_specific_content_type( # pylint: disable=inconsistent-r return cls(pipeline_response, None, {}) # type: ignore @overload - def file_with_http_part_required_content_type( # pylint: disable=inconsistent-return-statements,name-too-long + def required_content_type( # pylint: disable=inconsistent-return-statements self, body: _models.FileWithHttpPartRequiredContentTypeRequest, **kwargs: Any ) -> None: """Test content-type: multipart/form-data. @@ -821,7 +958,7 @@ def file_with_http_part_required_content_type( # pylint: disable=inconsistent-r """ @overload - def file_with_http_part_required_content_type( # pylint: disable=inconsistent-return-statements,name-too-long + def required_content_type( # pylint: disable=inconsistent-return-statements self, body: JSON, **kwargs: Any ) -> None: """Test content-type: multipart/form-data. @@ -834,7 +971,7 @@ def file_with_http_part_required_content_type( # pylint: disable=inconsistent-r """ @distributed_trace - def file_with_http_part_required_content_type( # pylint: disable=inconsistent-return-statements,name-too-long + def required_content_type( # pylint: disable=inconsistent-return-statements self, body: Union[_models.FileWithHttpPartRequiredContentTypeRequest, JSON], **kwargs: Any ) -> None: """Test content-type: multipart/form-data. @@ -864,7 +1001,7 @@ def file_with_http_part_required_content_type( # pylint: disable=inconsistent-r _data_fields: List[str] = [] _files, _data = prepare_multipart_form_data(_body, _file_fields, _data_fields) - _request = build_form_data_file_with_http_part_required_content_type_request( + _request = build_form_data_http_parts_content_type_required_content_type_request( files=_files, data=_data, headers=_headers, @@ -890,7 +1027,7 @@ def file_with_http_part_required_content_type( # pylint: disable=inconsistent-r return cls(pipeline_response, None, {}) # type: ignore @overload - def file_with_http_part_optional_content_type( # pylint: disable=inconsistent-return-statements,name-too-long + def optional_content_type( # pylint: disable=inconsistent-return-statements self, body: _models.FileWithHttpPartOptionalContentTypeRequest, **kwargs: Any ) -> None: """Test content-type: multipart/form-data for optional content type. @@ -903,7 +1040,7 @@ def file_with_http_part_optional_content_type( # pylint: disable=inconsistent-r """ @overload - def file_with_http_part_optional_content_type( # pylint: disable=inconsistent-return-statements,name-too-long + def optional_content_type( # pylint: disable=inconsistent-return-statements self, body: JSON, **kwargs: Any ) -> None: """Test content-type: multipart/form-data for optional content type. @@ -916,7 +1053,7 @@ def file_with_http_part_optional_content_type( # pylint: disable=inconsistent-r """ @distributed_trace - def file_with_http_part_optional_content_type( # pylint: disable=inconsistent-return-statements,name-too-long + def optional_content_type( # pylint: disable=inconsistent-return-statements self, body: Union[_models.FileWithHttpPartOptionalContentTypeRequest, JSON], **kwargs: Any ) -> None: """Test content-type: multipart/form-data for optional content type. @@ -946,7 +1083,7 @@ def file_with_http_part_optional_content_type( # pylint: disable=inconsistent-r _data_fields: List[str] = [] _files, _data = prepare_multipart_form_data(_body, _file_fields, _data_fields) - _request = build_form_data_file_with_http_part_optional_content_type_request( + _request = build_form_data_http_parts_content_type_optional_content_type_request( files=_files, data=_data, headers=_headers, @@ -971,24 +1108,40 @@ def file_with_http_part_optional_content_type( # pylint: disable=inconsistent-r if cls: return cls(pipeline_response, None, {}) # type: ignore + +class FormDataHttpPartsNonStringOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~payload.multipart.MultiPartClient`'s + :attr:`non_string` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @overload - def complex_with_http_part( # pylint: disable=inconsistent-return-statements - self, body: _models.ComplexHttpPartsModelRequest, **kwargs: Any + def float( # pylint: disable=inconsistent-return-statements + self, body: _models.FloatRequest, **kwargs: Any ) -> None: - """Test content-type: multipart/form-data for mixed scenarios. + """Test content-type: multipart/form-data for non string. :param body: Required. - :type body: ~payload.multipart.models.ComplexHttpPartsModelRequest + :type body: ~payload.multipart.models.FloatRequest :return: None :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def complex_with_http_part( # pylint: disable=inconsistent-return-statements - self, body: JSON, **kwargs: Any - ) -> None: - """Test content-type: multipart/form-data for mixed scenarios. + def float(self, body: JSON, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """Test content-type: multipart/form-data for non string. :param body: Required. :type body: JSON @@ -998,13 +1151,13 @@ def complex_with_http_part( # pylint: disable=inconsistent-return-statements """ @distributed_trace - def complex_with_http_part( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.ComplexHttpPartsModelRequest, JSON], **kwargs: Any + def float( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.FloatRequest, JSON], **kwargs: Any ) -> None: - """Test content-type: multipart/form-data for mixed scenarios. + """Test content-type: multipart/form-data for non string. - :param body: Is either a ComplexHttpPartsModelRequest type or a JSON type. Required. - :type body: ~payload.multipart.models.ComplexHttpPartsModelRequest or JSON + :param body: Is either a FloatRequest type or a JSON type. Required. + :type body: ~payload.multipart.models.FloatRequest or JSON :return: None :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -1023,11 +1176,11 @@ def complex_with_http_part( # pylint: disable=inconsistent-return-statements cls: ClsType[None] = kwargs.pop("cls", None) _body = body.as_dict() if isinstance(body, _model_base.Model) else body - _file_fields: List[str] = ["profileImage", "pictures"] - _data_fields: List[str] = ["id", "address", "previousAddresses"] + _file_fields: List[str] = [] + _data_fields: List[str] = ["temperature"] _files, _data = prepare_multipart_form_data(_body, _file_fields, _data_fields) - _request = build_form_data_complex_with_http_part_request( + _request = build_form_data_http_parts_non_string_float_request( files=_files, data=_data, headers=_headers, diff --git a/packages/typespec-python/test/azure/generated/routes/CHANGELOG.md b/packages/typespec-python/test/azure/generated/routes/CHANGELOG.md new file mode 100644 index 00000000000..628743d283a --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0b1 (1970-01-01) + +- Initial version diff --git a/packages/typespec-python/test/azure/generated/routes/LICENSE b/packages/typespec-python/test/azure/generated/routes/LICENSE new file mode 100644 index 00000000000..63447fd8bbb --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/LICENSE @@ -0,0 +1,21 @@ +Copyright (c) Microsoft Corporation. + +MIT License + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/packages/typespec-python/test/azure/generated/routes/MANIFEST.in b/packages/typespec-python/test/azure/generated/routes/MANIFEST.in new file mode 100644 index 00000000000..d3777f92f7f --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/MANIFEST.in @@ -0,0 +1,5 @@ +include *.md +include LICENSE +include routes/py.typed +recursive-include tests *.py +recursive-include samples *.py *.md \ No newline at end of file diff --git a/packages/typespec-python/test/azure/generated/routes/README.md b/packages/typespec-python/test/azure/generated/routes/README.md new file mode 100644 index 00000000000..492036ee953 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/README.md @@ -0,0 +1,45 @@ + + +# Routes client library for Python + + +## Getting started + +### Install the package + +```bash +python -m pip install routes +``` + +#### Prequisites + +- Python 3.8 or later is required to use this package. +- You need an [Azure subscription][azure_sub] to use this package. +- An existing Routes instance. + +## Contributing + +This project welcomes contributions and suggestions. Most contributions require +you to agree to a Contributor License Agreement (CLA) declaring that you have +the right to, and actually do, grant us the rights to use your contribution. +For details, visit https://cla.microsoft.com. + +When you submit a pull request, a CLA-bot will automatically determine whether +you need to provide a CLA and decorate the PR appropriately (e.g., label, +comment). Simply follow the instructions provided by the bot. You will only +need to do this once across all repos using our CLA. + +This project has adopted the +[Microsoft Open Source Code of Conduct][code_of_conduct]. For more information, +see the Code of Conduct FAQ or contact opencode@microsoft.com with any +additional questions or comments. + + +[code_of_conduct]: https://opensource.microsoft.com/codeofconduct/ +[authenticate_with_token]: https://docs.microsoft.com/azure/cognitive-services/authentication?tabs=powershell#authenticate-with-an-authentication-token +[azure_identity_credentials]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#credentials +[azure_identity_pip]: https://pypi.org/project/azure-identity/ +[default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential +[pip]: https://pypi.org/project/pip/ +[azure_sub]: https://azure.microsoft.com/free/ + diff --git a/packages/typespec-python/test/azure/generated/routes/apiview_mapping_python.json b/packages/typespec-python/test/azure/generated/routes/apiview_mapping_python.json new file mode 100644 index 00000000000..32f13db89fc --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/apiview_mapping_python.json @@ -0,0 +1,13 @@ +{ + "CrossLanguagePackageId": "Routes", + "CrossLanguageDefinitionId": { + "routes.RoutesClient.path_parameters.template_only": "Routes.PathParameters.templateOnly", + "routes.RoutesClient.path_parameters.explicit": "Routes.PathParameters.explicit", + "routes.RoutesClient.path_parameters.annotation_only": "Routes.PathParameters.annotationOnly", + "routes.RoutesClient.query_parameters.template_only": "Routes.QueryParameters.templateOnly", + "routes.RoutesClient.query_parameters.explicit": "Routes.QueryParameters.explicit", + "routes.RoutesClient.query_parameters.annotation_only": "Routes.QueryParameters.annotationOnly", + "routes.RoutesClient.in_interface.fixed": "Routes.InInterface.fixed", + "routes.RoutesClient.fixed": "Routes.fixed" + } +} \ No newline at end of file diff --git a/packages/typespec-python/test/azure/generated/routes/dev_requirements.txt b/packages/typespec-python/test/azure/generated/routes/dev_requirements.txt new file mode 100644 index 00000000000..10548647144 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/dev_requirements.txt @@ -0,0 +1,3 @@ +-e ../../../tools/azure-sdk-tools +../../core/azure-core +aiohttp \ No newline at end of file diff --git a/packages/typespec-python/test/azure/generated/routes/generated_tests/conftest.py b/packages/typespec-python/test/azure/generated/routes/generated_tests/conftest.py new file mode 100644 index 00000000000..aabc42e083c --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/generated_tests/conftest.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import os +import pytest +from dotenv import load_dotenv +from devtools_testutils import ( + test_proxy, + add_general_regex_sanitizer, + add_body_key_sanitizer, + add_header_regex_sanitizer, +) + +load_dotenv() + + +# aovid record sensitive identity information in recordings +@pytest.fixture(scope="session", autouse=True) +def add_sanitizers(test_proxy): + routes_subscription_id = os.environ.get("ROUTES_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000") + routes_tenant_id = os.environ.get("ROUTES_TENANT_ID", "00000000-0000-0000-0000-000000000000") + routes_client_id = os.environ.get("ROUTES_CLIENT_ID", "00000000-0000-0000-0000-000000000000") + routes_client_secret = os.environ.get("ROUTES_CLIENT_SECRET", "00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=routes_subscription_id, value="00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=routes_tenant_id, value="00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=routes_client_id, value="00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=routes_client_secret, value="00000000-0000-0000-0000-000000000000") + + add_header_regex_sanitizer(key="Set-Cookie", value="[set-cookie;]") + add_header_regex_sanitizer(key="Cookie", value="cookie;") + add_body_key_sanitizer(json_path="$..access_token", value="access_token") diff --git a/packages/typespec-python/test/azure/generated/routes/generated_tests/test_routes.py b/packages/typespec-python/test/azure/generated/routes/generated_tests/test_routes.py new file mode 100644 index 00000000000..76ea321422e --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/generated_tests/test_routes.py @@ -0,0 +1,22 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from devtools_testutils import recorded_by_proxy +from testpreparer import RoutesClientTestBase, RoutesPreparer + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestRoutes(RoutesClientTestBase): + @RoutesPreparer() + @recorded_by_proxy + def test_fixed(self, routes_endpoint): + client = self.create_client(endpoint=routes_endpoint) + response = client.fixed() + + # please add some check logic here by yourself + # ... diff --git a/packages/typespec-python/test/azure/generated/routes/generated_tests/test_routes_async.py b/packages/typespec-python/test/azure/generated/routes/generated_tests/test_routes_async.py new file mode 100644 index 00000000000..705ab5d1955 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/generated_tests/test_routes_async.py @@ -0,0 +1,23 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from devtools_testutils.aio import recorded_by_proxy_async +from testpreparer import RoutesPreparer +from testpreparer_async import RoutesClientTestBaseAsync + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestRoutesAsync(RoutesClientTestBaseAsync): + @RoutesPreparer() + @recorded_by_proxy_async + async def test_fixed(self, routes_endpoint): + client = self.create_async_client(endpoint=routes_endpoint) + response = await client.fixed() + + # please add some check logic here by yourself + # ... diff --git a/packages/typespec-python/test/azure/generated/routes/generated_tests/test_routes_in_interface_operations.py b/packages/typespec-python/test/azure/generated/routes/generated_tests/test_routes_in_interface_operations.py new file mode 100644 index 00000000000..4c2c9a7be14 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/generated_tests/test_routes_in_interface_operations.py @@ -0,0 +1,22 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from devtools_testutils import recorded_by_proxy +from testpreparer import RoutesClientTestBase, RoutesPreparer + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestRoutesInInterfaceOperations(RoutesClientTestBase): + @RoutesPreparer() + @recorded_by_proxy + def test_in_interface_fixed(self, routes_endpoint): + client = self.create_client(endpoint=routes_endpoint) + response = client.in_interface.fixed() + + # please add some check logic here by yourself + # ... diff --git a/packages/typespec-python/test/azure/generated/routes/generated_tests/test_routes_in_interface_operations_async.py b/packages/typespec-python/test/azure/generated/routes/generated_tests/test_routes_in_interface_operations_async.py new file mode 100644 index 00000000000..1fac7cb10fe --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/generated_tests/test_routes_in_interface_operations_async.py @@ -0,0 +1,23 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from devtools_testutils.aio import recorded_by_proxy_async +from testpreparer import RoutesPreparer +from testpreparer_async import RoutesClientTestBaseAsync + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestRoutesInInterfaceOperationsAsync(RoutesClientTestBaseAsync): + @RoutesPreparer() + @recorded_by_proxy_async + async def test_in_interface_fixed(self, routes_endpoint): + client = self.create_async_client(endpoint=routes_endpoint) + response = await client.in_interface.fixed() + + # please add some check logic here by yourself + # ... diff --git a/packages/typespec-python/test/azure/generated/routes/generated_tests/test_routes_path_parameters_operations.py b/packages/typespec-python/test/azure/generated/routes/generated_tests/test_routes_path_parameters_operations.py new file mode 100644 index 00000000000..20cf78b6765 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/generated_tests/test_routes_path_parameters_operations.py @@ -0,0 +1,332 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from devtools_testutils import recorded_by_proxy +from testpreparer import RoutesClientTestBase, RoutesPreparer + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestRoutesPathParametersOperations(RoutesClientTestBase): + @RoutesPreparer() + @recorded_by_proxy + def test_path_parameters_template_only(self, routes_endpoint): + client = self.create_client(endpoint=routes_endpoint) + response = client.path_parameters.template_only( + param="str", + ) + + # please add some check logic here by yourself + # ... + + @RoutesPreparer() + @recorded_by_proxy + def test_path_parameters_explicit(self, routes_endpoint): + client = self.create_client(endpoint=routes_endpoint) + response = client.path_parameters.explicit( + param="str", + ) + + # please add some check logic here by yourself + # ... + + @RoutesPreparer() + @recorded_by_proxy + def test_path_parameters_annotation_only(self, routes_endpoint): + client = self.create_client(endpoint=routes_endpoint) + response = client.path_parameters.annotation_only( + param="str", + ) + + # please add some check logic here by yourself + # ... + + @RoutesPreparer() + @recorded_by_proxy + def test_path_parameters_reserved_expansion_template(self, routes_endpoint): + client = self.create_client(endpoint=routes_endpoint) + response = client.path_parameters.reserved_expansion.template( + param="str", + ) + + # please add some check logic here by yourself + # ... + + @RoutesPreparer() + @recorded_by_proxy + def test_path_parameters_reserved_expansion_annotation(self, routes_endpoint): + client = self.create_client(endpoint=routes_endpoint) + response = client.path_parameters.reserved_expansion.annotation( + param="str", + ) + + # please add some check logic here by yourself + # ... + + @RoutesPreparer() + @recorded_by_proxy + def test_path_parameters_simple_expansion_standard_primitive(self, routes_endpoint): + client = self.create_client(endpoint=routes_endpoint) + response = client.path_parameters.simple_expansion.standard.primitive( + param="str", + ) + + # please add some check logic here by yourself + # ... + + @RoutesPreparer() + @recorded_by_proxy + def test_path_parameters_simple_expansion_standard_array(self, routes_endpoint): + client = self.create_client(endpoint=routes_endpoint) + response = client.path_parameters.simple_expansion.standard.array( + param=["str"], + ) + + # please add some check logic here by yourself + # ... + + @RoutesPreparer() + @recorded_by_proxy + def test_path_parameters_simple_expansion_standard_record(self, routes_endpoint): + client = self.create_client(endpoint=routes_endpoint) + response = client.path_parameters.simple_expansion.standard.record( + param={"str": 0}, + ) + + # please add some check logic here by yourself + # ... + + @RoutesPreparer() + @recorded_by_proxy + def test_path_parameters_simple_expansion_explode_primitive(self, routes_endpoint): + client = self.create_client(endpoint=routes_endpoint) + response = client.path_parameters.simple_expansion.explode.primitive( + param="str", + ) + + # please add some check logic here by yourself + # ... + + @RoutesPreparer() + @recorded_by_proxy + def test_path_parameters_simple_expansion_explode_array(self, routes_endpoint): + client = self.create_client(endpoint=routes_endpoint) + response = client.path_parameters.simple_expansion.explode.array( + param=["str"], + ) + + # please add some check logic here by yourself + # ... + + @RoutesPreparer() + @recorded_by_proxy + def test_path_parameters_simple_expansion_explode_record(self, routes_endpoint): + client = self.create_client(endpoint=routes_endpoint) + response = client.path_parameters.simple_expansion.explode.record( + param={"str": 0}, + ) + + # please add some check logic here by yourself + # ... + + @RoutesPreparer() + @recorded_by_proxy + def test_path_parameters_path_expansion_standard_primitive(self, routes_endpoint): + client = self.create_client(endpoint=routes_endpoint) + response = client.path_parameters.path_expansion.standard.primitive( + param="str", + ) + + # please add some check logic here by yourself + # ... + + @RoutesPreparer() + @recorded_by_proxy + def test_path_parameters_path_expansion_standard_array(self, routes_endpoint): + client = self.create_client(endpoint=routes_endpoint) + response = client.path_parameters.path_expansion.standard.array( + param=["str"], + ) + + # please add some check logic here by yourself + # ... + + @RoutesPreparer() + @recorded_by_proxy + def test_path_parameters_path_expansion_standard_record(self, routes_endpoint): + client = self.create_client(endpoint=routes_endpoint) + response = client.path_parameters.path_expansion.standard.record( + param={"str": 0}, + ) + + # please add some check logic here by yourself + # ... + + @RoutesPreparer() + @recorded_by_proxy + def test_path_parameters_path_expansion_explode_primitive(self, routes_endpoint): + client = self.create_client(endpoint=routes_endpoint) + response = client.path_parameters.path_expansion.explode.primitive( + param="str", + ) + + # please add some check logic here by yourself + # ... + + @RoutesPreparer() + @recorded_by_proxy + def test_path_parameters_path_expansion_explode_array(self, routes_endpoint): + client = self.create_client(endpoint=routes_endpoint) + response = client.path_parameters.path_expansion.explode.array( + param=["str"], + ) + + # please add some check logic here by yourself + # ... + + @RoutesPreparer() + @recorded_by_proxy + def test_path_parameters_path_expansion_explode_record(self, routes_endpoint): + client = self.create_client(endpoint=routes_endpoint) + response = client.path_parameters.path_expansion.explode.record( + param={"str": 0}, + ) + + # please add some check logic here by yourself + # ... + + @RoutesPreparer() + @recorded_by_proxy + def test_path_parameters_label_expansion_standard_primitive(self, routes_endpoint): + client = self.create_client(endpoint=routes_endpoint) + response = client.path_parameters.label_expansion.standard.primitive( + param="str", + ) + + # please add some check logic here by yourself + # ... + + @RoutesPreparer() + @recorded_by_proxy + def test_path_parameters_label_expansion_standard_array(self, routes_endpoint): + client = self.create_client(endpoint=routes_endpoint) + response = client.path_parameters.label_expansion.standard.array( + param=["str"], + ) + + # please add some check logic here by yourself + # ... + + @RoutesPreparer() + @recorded_by_proxy + def test_path_parameters_label_expansion_standard_record(self, routes_endpoint): + client = self.create_client(endpoint=routes_endpoint) + response = client.path_parameters.label_expansion.standard.record( + param={"str": 0}, + ) + + # please add some check logic here by yourself + # ... + + @RoutesPreparer() + @recorded_by_proxy + def test_path_parameters_label_expansion_explode_primitive(self, routes_endpoint): + client = self.create_client(endpoint=routes_endpoint) + response = client.path_parameters.label_expansion.explode.primitive( + param="str", + ) + + # please add some check logic here by yourself + # ... + + @RoutesPreparer() + @recorded_by_proxy + def test_path_parameters_label_expansion_explode_array(self, routes_endpoint): + client = self.create_client(endpoint=routes_endpoint) + response = client.path_parameters.label_expansion.explode.array( + param=["str"], + ) + + # please add some check logic here by yourself + # ... + + @RoutesPreparer() + @recorded_by_proxy + def test_path_parameters_label_expansion_explode_record(self, routes_endpoint): + client = self.create_client(endpoint=routes_endpoint) + response = client.path_parameters.label_expansion.explode.record( + param={"str": 0}, + ) + + # please add some check logic here by yourself + # ... + + @RoutesPreparer() + @recorded_by_proxy + def test_path_parameters_matrix_expansion_standard_primitive(self, routes_endpoint): + client = self.create_client(endpoint=routes_endpoint) + response = client.path_parameters.matrix_expansion.standard.primitive( + param="str", + ) + + # please add some check logic here by yourself + # ... + + @RoutesPreparer() + @recorded_by_proxy + def test_path_parameters_matrix_expansion_standard_array(self, routes_endpoint): + client = self.create_client(endpoint=routes_endpoint) + response = client.path_parameters.matrix_expansion.standard.array( + param=["str"], + ) + + # please add some check logic here by yourself + # ... + + @RoutesPreparer() + @recorded_by_proxy + def test_path_parameters_matrix_expansion_standard_record(self, routes_endpoint): + client = self.create_client(endpoint=routes_endpoint) + response = client.path_parameters.matrix_expansion.standard.record( + param={"str": 0}, + ) + + # please add some check logic here by yourself + # ... + + @RoutesPreparer() + @recorded_by_proxy + def test_path_parameters_matrix_expansion_explode_primitive(self, routes_endpoint): + client = self.create_client(endpoint=routes_endpoint) + response = client.path_parameters.matrix_expansion.explode.primitive( + param="str", + ) + + # please add some check logic here by yourself + # ... + + @RoutesPreparer() + @recorded_by_proxy + def test_path_parameters_matrix_expansion_explode_array(self, routes_endpoint): + client = self.create_client(endpoint=routes_endpoint) + response = client.path_parameters.matrix_expansion.explode.array( + param=["str"], + ) + + # please add some check logic here by yourself + # ... + + @RoutesPreparer() + @recorded_by_proxy + def test_path_parameters_matrix_expansion_explode_record(self, routes_endpoint): + client = self.create_client(endpoint=routes_endpoint) + response = client.path_parameters.matrix_expansion.explode.record( + param={"str": 0}, + ) + + # please add some check logic here by yourself + # ... diff --git a/packages/typespec-python/test/azure/generated/routes/generated_tests/test_routes_path_parameters_operations_async.py b/packages/typespec-python/test/azure/generated/routes/generated_tests/test_routes_path_parameters_operations_async.py new file mode 100644 index 00000000000..c73a227f87e --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/generated_tests/test_routes_path_parameters_operations_async.py @@ -0,0 +1,333 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from devtools_testutils.aio import recorded_by_proxy_async +from testpreparer import RoutesPreparer +from testpreparer_async import RoutesClientTestBaseAsync + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestRoutesPathParametersOperationsAsync(RoutesClientTestBaseAsync): + @RoutesPreparer() + @recorded_by_proxy_async + async def test_path_parameters_template_only(self, routes_endpoint): + client = self.create_async_client(endpoint=routes_endpoint) + response = await client.path_parameters.template_only( + param="str", + ) + + # please add some check logic here by yourself + # ... + + @RoutesPreparer() + @recorded_by_proxy_async + async def test_path_parameters_explicit(self, routes_endpoint): + client = self.create_async_client(endpoint=routes_endpoint) + response = await client.path_parameters.explicit( + param="str", + ) + + # please add some check logic here by yourself + # ... + + @RoutesPreparer() + @recorded_by_proxy_async + async def test_path_parameters_annotation_only(self, routes_endpoint): + client = self.create_async_client(endpoint=routes_endpoint) + response = await client.path_parameters.annotation_only( + param="str", + ) + + # please add some check logic here by yourself + # ... + + @RoutesPreparer() + @recorded_by_proxy_async + async def test_path_parameters_reserved_expansion_template(self, routes_endpoint): + client = self.create_async_client(endpoint=routes_endpoint) + response = await client.path_parameters.reserved_expansion.template( + param="str", + ) + + # please add some check logic here by yourself + # ... + + @RoutesPreparer() + @recorded_by_proxy_async + async def test_path_parameters_reserved_expansion_annotation(self, routes_endpoint): + client = self.create_async_client(endpoint=routes_endpoint) + response = await client.path_parameters.reserved_expansion.annotation( + param="str", + ) + + # please add some check logic here by yourself + # ... + + @RoutesPreparer() + @recorded_by_proxy_async + async def test_path_parameters_simple_expansion_standard_primitive(self, routes_endpoint): + client = self.create_async_client(endpoint=routes_endpoint) + response = await client.path_parameters.simple_expansion.standard.primitive( + param="str", + ) + + # please add some check logic here by yourself + # ... + + @RoutesPreparer() + @recorded_by_proxy_async + async def test_path_parameters_simple_expansion_standard_array(self, routes_endpoint): + client = self.create_async_client(endpoint=routes_endpoint) + response = await client.path_parameters.simple_expansion.standard.array( + param=["str"], + ) + + # please add some check logic here by yourself + # ... + + @RoutesPreparer() + @recorded_by_proxy_async + async def test_path_parameters_simple_expansion_standard_record(self, routes_endpoint): + client = self.create_async_client(endpoint=routes_endpoint) + response = await client.path_parameters.simple_expansion.standard.record( + param={"str": 0}, + ) + + # please add some check logic here by yourself + # ... + + @RoutesPreparer() + @recorded_by_proxy_async + async def test_path_parameters_simple_expansion_explode_primitive(self, routes_endpoint): + client = self.create_async_client(endpoint=routes_endpoint) + response = await client.path_parameters.simple_expansion.explode.primitive( + param="str", + ) + + # please add some check logic here by yourself + # ... + + @RoutesPreparer() + @recorded_by_proxy_async + async def test_path_parameters_simple_expansion_explode_array(self, routes_endpoint): + client = self.create_async_client(endpoint=routes_endpoint) + response = await client.path_parameters.simple_expansion.explode.array( + param=["str"], + ) + + # please add some check logic here by yourself + # ... + + @RoutesPreparer() + @recorded_by_proxy_async + async def test_path_parameters_simple_expansion_explode_record(self, routes_endpoint): + client = self.create_async_client(endpoint=routes_endpoint) + response = await client.path_parameters.simple_expansion.explode.record( + param={"str": 0}, + ) + + # please add some check logic here by yourself + # ... + + @RoutesPreparer() + @recorded_by_proxy_async + async def test_path_parameters_path_expansion_standard_primitive(self, routes_endpoint): + client = self.create_async_client(endpoint=routes_endpoint) + response = await client.path_parameters.path_expansion.standard.primitive( + param="str", + ) + + # please add some check logic here by yourself + # ... + + @RoutesPreparer() + @recorded_by_proxy_async + async def test_path_parameters_path_expansion_standard_array(self, routes_endpoint): + client = self.create_async_client(endpoint=routes_endpoint) + response = await client.path_parameters.path_expansion.standard.array( + param=["str"], + ) + + # please add some check logic here by yourself + # ... + + @RoutesPreparer() + @recorded_by_proxy_async + async def test_path_parameters_path_expansion_standard_record(self, routes_endpoint): + client = self.create_async_client(endpoint=routes_endpoint) + response = await client.path_parameters.path_expansion.standard.record( + param={"str": 0}, + ) + + # please add some check logic here by yourself + # ... + + @RoutesPreparer() + @recorded_by_proxy_async + async def test_path_parameters_path_expansion_explode_primitive(self, routes_endpoint): + client = self.create_async_client(endpoint=routes_endpoint) + response = await client.path_parameters.path_expansion.explode.primitive( + param="str", + ) + + # please add some check logic here by yourself + # ... + + @RoutesPreparer() + @recorded_by_proxy_async + async def test_path_parameters_path_expansion_explode_array(self, routes_endpoint): + client = self.create_async_client(endpoint=routes_endpoint) + response = await client.path_parameters.path_expansion.explode.array( + param=["str"], + ) + + # please add some check logic here by yourself + # ... + + @RoutesPreparer() + @recorded_by_proxy_async + async def test_path_parameters_path_expansion_explode_record(self, routes_endpoint): + client = self.create_async_client(endpoint=routes_endpoint) + response = await client.path_parameters.path_expansion.explode.record( + param={"str": 0}, + ) + + # please add some check logic here by yourself + # ... + + @RoutesPreparer() + @recorded_by_proxy_async + async def test_path_parameters_label_expansion_standard_primitive(self, routes_endpoint): + client = self.create_async_client(endpoint=routes_endpoint) + response = await client.path_parameters.label_expansion.standard.primitive( + param="str", + ) + + # please add some check logic here by yourself + # ... + + @RoutesPreparer() + @recorded_by_proxy_async + async def test_path_parameters_label_expansion_standard_array(self, routes_endpoint): + client = self.create_async_client(endpoint=routes_endpoint) + response = await client.path_parameters.label_expansion.standard.array( + param=["str"], + ) + + # please add some check logic here by yourself + # ... + + @RoutesPreparer() + @recorded_by_proxy_async + async def test_path_parameters_label_expansion_standard_record(self, routes_endpoint): + client = self.create_async_client(endpoint=routes_endpoint) + response = await client.path_parameters.label_expansion.standard.record( + param={"str": 0}, + ) + + # please add some check logic here by yourself + # ... + + @RoutesPreparer() + @recorded_by_proxy_async + async def test_path_parameters_label_expansion_explode_primitive(self, routes_endpoint): + client = self.create_async_client(endpoint=routes_endpoint) + response = await client.path_parameters.label_expansion.explode.primitive( + param="str", + ) + + # please add some check logic here by yourself + # ... + + @RoutesPreparer() + @recorded_by_proxy_async + async def test_path_parameters_label_expansion_explode_array(self, routes_endpoint): + client = self.create_async_client(endpoint=routes_endpoint) + response = await client.path_parameters.label_expansion.explode.array( + param=["str"], + ) + + # please add some check logic here by yourself + # ... + + @RoutesPreparer() + @recorded_by_proxy_async + async def test_path_parameters_label_expansion_explode_record(self, routes_endpoint): + client = self.create_async_client(endpoint=routes_endpoint) + response = await client.path_parameters.label_expansion.explode.record( + param={"str": 0}, + ) + + # please add some check logic here by yourself + # ... + + @RoutesPreparer() + @recorded_by_proxy_async + async def test_path_parameters_matrix_expansion_standard_primitive(self, routes_endpoint): + client = self.create_async_client(endpoint=routes_endpoint) + response = await client.path_parameters.matrix_expansion.standard.primitive( + param="str", + ) + + # please add some check logic here by yourself + # ... + + @RoutesPreparer() + @recorded_by_proxy_async + async def test_path_parameters_matrix_expansion_standard_array(self, routes_endpoint): + client = self.create_async_client(endpoint=routes_endpoint) + response = await client.path_parameters.matrix_expansion.standard.array( + param=["str"], + ) + + # please add some check logic here by yourself + # ... + + @RoutesPreparer() + @recorded_by_proxy_async + async def test_path_parameters_matrix_expansion_standard_record(self, routes_endpoint): + client = self.create_async_client(endpoint=routes_endpoint) + response = await client.path_parameters.matrix_expansion.standard.record( + param={"str": 0}, + ) + + # please add some check logic here by yourself + # ... + + @RoutesPreparer() + @recorded_by_proxy_async + async def test_path_parameters_matrix_expansion_explode_primitive(self, routes_endpoint): + client = self.create_async_client(endpoint=routes_endpoint) + response = await client.path_parameters.matrix_expansion.explode.primitive( + param="str", + ) + + # please add some check logic here by yourself + # ... + + @RoutesPreparer() + @recorded_by_proxy_async + async def test_path_parameters_matrix_expansion_explode_array(self, routes_endpoint): + client = self.create_async_client(endpoint=routes_endpoint) + response = await client.path_parameters.matrix_expansion.explode.array( + param=["str"], + ) + + # please add some check logic here by yourself + # ... + + @RoutesPreparer() + @recorded_by_proxy_async + async def test_path_parameters_matrix_expansion_explode_record(self, routes_endpoint): + client = self.create_async_client(endpoint=routes_endpoint) + response = await client.path_parameters.matrix_expansion.explode.record( + param={"str": 0}, + ) + + # please add some check logic here by yourself + # ... diff --git a/packages/typespec-python/test/azure/generated/routes/generated_tests/test_routes_query_parameters_operations.py b/packages/typespec-python/test/azure/generated/routes/generated_tests/test_routes_query_parameters_operations.py new file mode 100644 index 00000000000..566ff148af5 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/generated_tests/test_routes_query_parameters_operations.py @@ -0,0 +1,178 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from devtools_testutils import recorded_by_proxy +from testpreparer import RoutesClientTestBase, RoutesPreparer + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestRoutesQueryParametersOperations(RoutesClientTestBase): + @RoutesPreparer() + @recorded_by_proxy + def test_query_parameters_template_only(self, routes_endpoint): + client = self.create_client(endpoint=routes_endpoint) + response = client.query_parameters.template_only( + param="str", + ) + + # please add some check logic here by yourself + # ... + + @RoutesPreparer() + @recorded_by_proxy + def test_query_parameters_explicit(self, routes_endpoint): + client = self.create_client(endpoint=routes_endpoint) + response = client.query_parameters.explicit( + param="str", + ) + + # please add some check logic here by yourself + # ... + + @RoutesPreparer() + @recorded_by_proxy + def test_query_parameters_annotation_only(self, routes_endpoint): + client = self.create_client(endpoint=routes_endpoint) + response = client.query_parameters.annotation_only( + param="str", + ) + + # please add some check logic here by yourself + # ... + + @RoutesPreparer() + @recorded_by_proxy + def test_query_parameters_query_expansion_standard_primitive(self, routes_endpoint): + client = self.create_client(endpoint=routes_endpoint) + response = client.query_parameters.query_expansion.standard.primitive( + param="str", + ) + + # please add some check logic here by yourself + # ... + + @RoutesPreparer() + @recorded_by_proxy + def test_query_parameters_query_expansion_standard_array(self, routes_endpoint): + client = self.create_client(endpoint=routes_endpoint) + response = client.query_parameters.query_expansion.standard.array( + param=["str"], + ) + + # please add some check logic here by yourself + # ... + + @RoutesPreparer() + @recorded_by_proxy + def test_query_parameters_query_expansion_standard_record(self, routes_endpoint): + client = self.create_client(endpoint=routes_endpoint) + response = client.query_parameters.query_expansion.standard.record( + param={"str": 0}, + ) + + # please add some check logic here by yourself + # ... + + @RoutesPreparer() + @recorded_by_proxy + def test_query_parameters_query_expansion_explode_primitive(self, routes_endpoint): + client = self.create_client(endpoint=routes_endpoint) + response = client.query_parameters.query_expansion.explode.primitive( + param="str", + ) + + # please add some check logic here by yourself + # ... + + @RoutesPreparer() + @recorded_by_proxy + def test_query_parameters_query_expansion_explode_array(self, routes_endpoint): + client = self.create_client(endpoint=routes_endpoint) + response = client.query_parameters.query_expansion.explode.array( + param=["str"], + ) + + # please add some check logic here by yourself + # ... + + @RoutesPreparer() + @recorded_by_proxy + def test_query_parameters_query_expansion_explode_record(self, routes_endpoint): + client = self.create_client(endpoint=routes_endpoint) + response = client.query_parameters.query_expansion.explode.record( + param={"str": 0}, + ) + + # please add some check logic here by yourself + # ... + + @RoutesPreparer() + @recorded_by_proxy + def test_query_parameters_query_continuation_standard_primitive(self, routes_endpoint): + client = self.create_client(endpoint=routes_endpoint) + response = client.query_parameters.query_continuation.standard.primitive( + param="str", + ) + + # please add some check logic here by yourself + # ... + + @RoutesPreparer() + @recorded_by_proxy + def test_query_parameters_query_continuation_standard_array(self, routes_endpoint): + client = self.create_client(endpoint=routes_endpoint) + response = client.query_parameters.query_continuation.standard.array( + param=["str"], + ) + + # please add some check logic here by yourself + # ... + + @RoutesPreparer() + @recorded_by_proxy + def test_query_parameters_query_continuation_standard_record(self, routes_endpoint): + client = self.create_client(endpoint=routes_endpoint) + response = client.query_parameters.query_continuation.standard.record( + param={"str": 0}, + ) + + # please add some check logic here by yourself + # ... + + @RoutesPreparer() + @recorded_by_proxy + def test_query_parameters_query_continuation_explode_primitive(self, routes_endpoint): + client = self.create_client(endpoint=routes_endpoint) + response = client.query_parameters.query_continuation.explode.primitive( + param="str", + ) + + # please add some check logic here by yourself + # ... + + @RoutesPreparer() + @recorded_by_proxy + def test_query_parameters_query_continuation_explode_array(self, routes_endpoint): + client = self.create_client(endpoint=routes_endpoint) + response = client.query_parameters.query_continuation.explode.array( + param=["str"], + ) + + # please add some check logic here by yourself + # ... + + @RoutesPreparer() + @recorded_by_proxy + def test_query_parameters_query_continuation_explode_record(self, routes_endpoint): + client = self.create_client(endpoint=routes_endpoint) + response = client.query_parameters.query_continuation.explode.record( + param={"str": 0}, + ) + + # please add some check logic here by yourself + # ... diff --git a/packages/typespec-python/test/azure/generated/routes/generated_tests/test_routes_query_parameters_operations_async.py b/packages/typespec-python/test/azure/generated/routes/generated_tests/test_routes_query_parameters_operations_async.py new file mode 100644 index 00000000000..c85cfc7ebd7 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/generated_tests/test_routes_query_parameters_operations_async.py @@ -0,0 +1,179 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from devtools_testutils.aio import recorded_by_proxy_async +from testpreparer import RoutesPreparer +from testpreparer_async import RoutesClientTestBaseAsync + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestRoutesQueryParametersOperationsAsync(RoutesClientTestBaseAsync): + @RoutesPreparer() + @recorded_by_proxy_async + async def test_query_parameters_template_only(self, routes_endpoint): + client = self.create_async_client(endpoint=routes_endpoint) + response = await client.query_parameters.template_only( + param="str", + ) + + # please add some check logic here by yourself + # ... + + @RoutesPreparer() + @recorded_by_proxy_async + async def test_query_parameters_explicit(self, routes_endpoint): + client = self.create_async_client(endpoint=routes_endpoint) + response = await client.query_parameters.explicit( + param="str", + ) + + # please add some check logic here by yourself + # ... + + @RoutesPreparer() + @recorded_by_proxy_async + async def test_query_parameters_annotation_only(self, routes_endpoint): + client = self.create_async_client(endpoint=routes_endpoint) + response = await client.query_parameters.annotation_only( + param="str", + ) + + # please add some check logic here by yourself + # ... + + @RoutesPreparer() + @recorded_by_proxy_async + async def test_query_parameters_query_expansion_standard_primitive(self, routes_endpoint): + client = self.create_async_client(endpoint=routes_endpoint) + response = await client.query_parameters.query_expansion.standard.primitive( + param="str", + ) + + # please add some check logic here by yourself + # ... + + @RoutesPreparer() + @recorded_by_proxy_async + async def test_query_parameters_query_expansion_standard_array(self, routes_endpoint): + client = self.create_async_client(endpoint=routes_endpoint) + response = await client.query_parameters.query_expansion.standard.array( + param=["str"], + ) + + # please add some check logic here by yourself + # ... + + @RoutesPreparer() + @recorded_by_proxy_async + async def test_query_parameters_query_expansion_standard_record(self, routes_endpoint): + client = self.create_async_client(endpoint=routes_endpoint) + response = await client.query_parameters.query_expansion.standard.record( + param={"str": 0}, + ) + + # please add some check logic here by yourself + # ... + + @RoutesPreparer() + @recorded_by_proxy_async + async def test_query_parameters_query_expansion_explode_primitive(self, routes_endpoint): + client = self.create_async_client(endpoint=routes_endpoint) + response = await client.query_parameters.query_expansion.explode.primitive( + param="str", + ) + + # please add some check logic here by yourself + # ... + + @RoutesPreparer() + @recorded_by_proxy_async + async def test_query_parameters_query_expansion_explode_array(self, routes_endpoint): + client = self.create_async_client(endpoint=routes_endpoint) + response = await client.query_parameters.query_expansion.explode.array( + param=["str"], + ) + + # please add some check logic here by yourself + # ... + + @RoutesPreparer() + @recorded_by_proxy_async + async def test_query_parameters_query_expansion_explode_record(self, routes_endpoint): + client = self.create_async_client(endpoint=routes_endpoint) + response = await client.query_parameters.query_expansion.explode.record( + param={"str": 0}, + ) + + # please add some check logic here by yourself + # ... + + @RoutesPreparer() + @recorded_by_proxy_async + async def test_query_parameters_query_continuation_standard_primitive(self, routes_endpoint): + client = self.create_async_client(endpoint=routes_endpoint) + response = await client.query_parameters.query_continuation.standard.primitive( + param="str", + ) + + # please add some check logic here by yourself + # ... + + @RoutesPreparer() + @recorded_by_proxy_async + async def test_query_parameters_query_continuation_standard_array(self, routes_endpoint): + client = self.create_async_client(endpoint=routes_endpoint) + response = await client.query_parameters.query_continuation.standard.array( + param=["str"], + ) + + # please add some check logic here by yourself + # ... + + @RoutesPreparer() + @recorded_by_proxy_async + async def test_query_parameters_query_continuation_standard_record(self, routes_endpoint): + client = self.create_async_client(endpoint=routes_endpoint) + response = await client.query_parameters.query_continuation.standard.record( + param={"str": 0}, + ) + + # please add some check logic here by yourself + # ... + + @RoutesPreparer() + @recorded_by_proxy_async + async def test_query_parameters_query_continuation_explode_primitive(self, routes_endpoint): + client = self.create_async_client(endpoint=routes_endpoint) + response = await client.query_parameters.query_continuation.explode.primitive( + param="str", + ) + + # please add some check logic here by yourself + # ... + + @RoutesPreparer() + @recorded_by_proxy_async + async def test_query_parameters_query_continuation_explode_array(self, routes_endpoint): + client = self.create_async_client(endpoint=routes_endpoint) + response = await client.query_parameters.query_continuation.explode.array( + param=["str"], + ) + + # please add some check logic here by yourself + # ... + + @RoutesPreparer() + @recorded_by_proxy_async + async def test_query_parameters_query_continuation_explode_record(self, routes_endpoint): + client = self.create_async_client(endpoint=routes_endpoint) + response = await client.query_parameters.query_continuation.explode.record( + param={"str": 0}, + ) + + # please add some check logic here by yourself + # ... diff --git a/packages/typespec-python/test/azure/generated/routes/generated_tests/testpreparer.py b/packages/typespec-python/test/azure/generated/routes/generated_tests/testpreparer.py new file mode 100644 index 00000000000..baf88af09ab --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/generated_tests/testpreparer.py @@ -0,0 +1,24 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from devtools_testutils import AzureRecordedTestCase, PowerShellPreparer +import functools +from routes import RoutesClient + + +class RoutesClientTestBase(AzureRecordedTestCase): + + def create_client(self, endpoint): + credential = self.get_credential(RoutesClient) + return self.create_client_from_credential( + RoutesClient, + credential=credential, + endpoint=endpoint, + ) + + +RoutesPreparer = functools.partial(PowerShellPreparer, "routes", routes_endpoint="https://fake_routes_endpoint.com") diff --git a/packages/typespec-python/test/azure/generated/routes/generated_tests/testpreparer_async.py b/packages/typespec-python/test/azure/generated/routes/generated_tests/testpreparer_async.py new file mode 100644 index 00000000000..3d66391fd7d --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/generated_tests/testpreparer_async.py @@ -0,0 +1,20 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from devtools_testutils import AzureRecordedTestCase +from routes.aio import RoutesClient + + +class RoutesClientTestBaseAsync(AzureRecordedTestCase): + + def create_async_client(self, endpoint): + credential = self.get_credential(RoutesClient, is_async=True) + return self.create_client_from_credential( + RoutesClient, + credential=credential, + endpoint=endpoint, + ) diff --git a/packages/typespec-python/test/azure/generated/routes/routes/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/__init__.py new file mode 100644 index 00000000000..185aabdddee --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/__init__.py @@ -0,0 +1,26 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._client import RoutesClient +from ._version import VERSION + +__version__ = VERSION + +try: + from ._patch import __all__ as _patch_all + from ._patch import * # pylint: disable=unused-wildcard-import +except ImportError: + _patch_all = [] +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "RoutesClient", +] +__all__.extend([p for p in _patch_all if p not in __all__]) + +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/routes/routes/_client.py b/packages/typespec-python/test/azure/generated/routes/routes/_client.py new file mode 100644 index 00000000000..7e94d2e04ef --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/_client.py @@ -0,0 +1,107 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from copy import deepcopy +from typing import Any +from typing_extensions import Self + +from azure.core import PipelineClient +from azure.core.pipeline import policies +from azure.core.rest import HttpRequest, HttpResponse + +from ._configuration import RoutesClientConfiguration +from ._serialization import Deserializer, Serializer +from .operations import ( + InInterfaceOperations, + PathParametersOperations, + QueryParametersOperations, + RoutesClientOperationsMixin, +) + + +class RoutesClient(RoutesClientOperationsMixin): # pylint: disable=client-accepts-api-version-keyword + """Define scenario in building the http route/uri. + + :ivar path_parameters: PathParametersOperations operations + :vartype path_parameters: routes.operations.PathParametersOperations + :ivar query_parameters: QueryParametersOperations operations + :vartype query_parameters: routes.operations.QueryParametersOperations + :ivar in_interface: InInterfaceOperations operations + :vartype in_interface: routes.operations.InInterfaceOperations + :keyword endpoint: Service host. Default value is "http://localhost:3000". + :paramtype endpoint: str + """ + + def __init__( # pylint: disable=missing-client-constructor-parameter-credential + self, *, endpoint: str = "http://localhost:3000", **kwargs: Any + ) -> None: + _endpoint = "{endpoint}" + self._config = RoutesClientConfiguration(endpoint=endpoint, **kwargs) + _policies = kwargs.pop("policies", None) + if _policies is None: + _policies = [ + policies.RequestIdPolicy(**kwargs), + self._config.headers_policy, + self._config.user_agent_policy, + self._config.proxy_policy, + policies.ContentDecodePolicy(**kwargs), + self._config.redirect_policy, + self._config.retry_policy, + self._config.authentication_policy, + self._config.custom_hook_policy, + self._config.logging_policy, + policies.DistributedTracingPolicy(**kwargs), + policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, + self._config.http_logging_policy, + ] + self._client: PipelineClient = PipelineClient(base_url=_endpoint, policies=_policies, **kwargs) + + self._serialize = Serializer() + self._deserialize = Deserializer() + self._serialize.client_side_validation = False + self.path_parameters = PathParametersOperations(self._client, self._config, self._serialize, self._deserialize) + self.query_parameters = QueryParametersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.in_interface = InInterfaceOperations(self._client, self._config, self._serialize, self._deserialize) + + def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: + """Runs the network request through the client's chained policies. + + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = client.send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.rest.HttpResponse + """ + + request_copy = deepcopy(request) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + + request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) + return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore + + def close(self) -> None: + self._client.close() + + def __enter__(self) -> Self: + self._client.__enter__() + return self + + def __exit__(self, *exc_details: Any) -> None: + self._client.__exit__(*exc_details) diff --git a/packages/typespec-python/test/azure/generated/routes/routes/_configuration.py b/packages/typespec-python/test/azure/generated/routes/routes/_configuration.py new file mode 100644 index 00000000000..f39ddcd510d --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/_configuration.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any + +from azure.core.pipeline import policies + +from ._version import VERSION + + +class RoutesClientConfiguration: # pylint: disable=too-many-instance-attributes + """Configuration for RoutesClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param endpoint: Service host. Default value is "http://localhost:3000". + :type endpoint: str + """ + + def __init__(self, endpoint: str = "http://localhost:3000", **kwargs: Any) -> None: + + self.endpoint = endpoint + kwargs.setdefault("sdk_moniker", "routes/{}".format(VERSION)) + self.polling_interval = kwargs.get("polling_interval", 30) + self._configure(**kwargs) + + def _configure(self, **kwargs: Any) -> None: + self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get("http_logging_policy") or policies.HttpLoggingPolicy(**kwargs) + self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") diff --git a/packages/typespec-python/test/azure/generated/routes/routes/_model_base.py b/packages/typespec-python/test/azure/generated/routes/routes/_model_base.py new file mode 100644 index 00000000000..a3c07cd8d89 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/_model_base.py @@ -0,0 +1,901 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# -------------------------------------------------------------------------- +# pylint: disable=protected-access, arguments-differ, signature-differs, broad-except + +import copy +import calendar +import decimal +import functools +import sys +import logging +import base64 +import re +import typing +import enum +import email.utils +from datetime import datetime, date, time, timedelta, timezone +from json import JSONEncoder +from typing_extensions import Self +import isodate +from azure.core.exceptions import DeserializationError +from azure.core import CaseInsensitiveEnumMeta +from azure.core.pipeline import PipelineResponse +from azure.core.serialization import _Null + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping + +_LOGGER = logging.getLogger(__name__) + +__all__ = ["SdkJSONEncoder", "Model", "rest_field", "rest_discriminator"] + +TZ_UTC = timezone.utc +_T = typing.TypeVar("_T") + + +def _timedelta_as_isostr(td: timedelta) -> str: + """Converts a datetime.timedelta object into an ISO 8601 formatted string, e.g. 'P4DT12H30M05S' + + Function adapted from the Tin Can Python project: https://github.com/RusticiSoftware/TinCanPython + + :param timedelta td: The timedelta to convert + :rtype: str + :return: ISO8601 version of this timedelta + """ + + # Split seconds to larger units + seconds = td.total_seconds() + minutes, seconds = divmod(seconds, 60) + hours, minutes = divmod(minutes, 60) + days, hours = divmod(hours, 24) + + days, hours, minutes = list(map(int, (days, hours, minutes))) + seconds = round(seconds, 6) + + # Build date + date_str = "" + if days: + date_str = "%sD" % days + + if hours or minutes or seconds: + # Build time + time_str = "T" + + # Hours + bigger_exists = date_str or hours + if bigger_exists: + time_str += "{:02}H".format(hours) + + # Minutes + bigger_exists = bigger_exists or minutes + if bigger_exists: + time_str += "{:02}M".format(minutes) + + # Seconds + try: + if seconds.is_integer(): + seconds_string = "{:02}".format(int(seconds)) + else: + # 9 chars long w/ leading 0, 6 digits after decimal + seconds_string = "%09.6f" % seconds + # Remove trailing zeros + seconds_string = seconds_string.rstrip("0") + except AttributeError: # int.is_integer() raises + seconds_string = "{:02}".format(seconds) + + time_str += "{}S".format(seconds_string) + else: + time_str = "" + + return "P" + date_str + time_str + + +def _serialize_bytes(o, format: typing.Optional[str] = None) -> str: + encoded = base64.b64encode(o).decode() + if format == "base64url": + return encoded.strip("=").replace("+", "-").replace("/", "_") + return encoded + + +def _serialize_datetime(o, format: typing.Optional[str] = None): + if hasattr(o, "year") and hasattr(o, "hour"): + if format == "rfc7231": + return email.utils.format_datetime(o, usegmt=True) + if format == "unix-timestamp": + return int(calendar.timegm(o.utctimetuple())) + + # astimezone() fails for naive times in Python 2.7, so make make sure o is aware (tzinfo is set) + if not o.tzinfo: + iso_formatted = o.replace(tzinfo=TZ_UTC).isoformat() + else: + iso_formatted = o.astimezone(TZ_UTC).isoformat() + # Replace the trailing "+00:00" UTC offset with "Z" (RFC 3339: https://www.ietf.org/rfc/rfc3339.txt) + return iso_formatted.replace("+00:00", "Z") + # Next try datetime.date or datetime.time + return o.isoformat() + + +def _is_readonly(p): + try: + return p._visibility == ["read"] # pylint: disable=protected-access + except AttributeError: + return False + + +class SdkJSONEncoder(JSONEncoder): + """A JSON encoder that's capable of serializing datetime objects and bytes.""" + + def __init__(self, *args, exclude_readonly: bool = False, format: typing.Optional[str] = None, **kwargs): + super().__init__(*args, **kwargs) + self.exclude_readonly = exclude_readonly + self.format = format + + def default(self, o): # pylint: disable=too-many-return-statements + if _is_model(o): + if self.exclude_readonly: + readonly_props = [p._rest_name for p in o._attr_to_rest_field.values() if _is_readonly(p)] + return {k: v for k, v in o.items() if k not in readonly_props} + return dict(o.items()) + try: + return super(SdkJSONEncoder, self).default(o) + except TypeError: + if isinstance(o, _Null): + return None + if isinstance(o, decimal.Decimal): + return float(o) + if isinstance(o, (bytes, bytearray)): + return _serialize_bytes(o, self.format) + try: + # First try datetime.datetime + return _serialize_datetime(o, self.format) + except AttributeError: + pass + # Last, try datetime.timedelta + try: + return _timedelta_as_isostr(o) + except AttributeError: + # This will be raised when it hits value.total_seconds in the method above + pass + return super(SdkJSONEncoder, self).default(o) + + +_VALID_DATE = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}" + r"\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") +_VALID_RFC7231 = re.compile( + r"(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s\d{2}\s" + r"(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s\d{4}\s\d{2}:\d{2}:\d{2}\sGMT" +) + + +def _deserialize_datetime(attr: typing.Union[str, datetime]) -> datetime: + """Deserialize ISO-8601 formatted string into Datetime object. + + :param str attr: response string to be deserialized. + :rtype: ~datetime.datetime + :returns: The datetime object from that input + """ + if isinstance(attr, datetime): + # i'm already deserialized + return attr + attr = attr.upper() + match = _VALID_DATE.match(attr) + if not match: + raise ValueError("Invalid datetime string: " + attr) + + check_decimal = attr.split(".") + if len(check_decimal) > 1: + decimal_str = "" + for digit in check_decimal[1]: + if digit.isdigit(): + decimal_str += digit + else: + break + if len(decimal_str) > 6: + attr = attr.replace(decimal_str, decimal_str[0:6]) + + date_obj = isodate.parse_datetime(attr) + test_utc = date_obj.utctimetuple() + if test_utc.tm_year > 9999 or test_utc.tm_year < 1: + raise OverflowError("Hit max or min date") + return date_obj + + +def _deserialize_datetime_rfc7231(attr: typing.Union[str, datetime]) -> datetime: + """Deserialize RFC7231 formatted string into Datetime object. + + :param str attr: response string to be deserialized. + :rtype: ~datetime.datetime + :returns: The datetime object from that input + """ + if isinstance(attr, datetime): + # i'm already deserialized + return attr + match = _VALID_RFC7231.match(attr) + if not match: + raise ValueError("Invalid datetime string: " + attr) + + return email.utils.parsedate_to_datetime(attr) + + +def _deserialize_datetime_unix_timestamp(attr: typing.Union[float, datetime]) -> datetime: + """Deserialize unix timestamp into Datetime object. + + :param str attr: response string to be deserialized. + :rtype: ~datetime.datetime + :returns: The datetime object from that input + """ + if isinstance(attr, datetime): + # i'm already deserialized + return attr + return datetime.fromtimestamp(attr, TZ_UTC) + + +def _deserialize_date(attr: typing.Union[str, date]) -> date: + """Deserialize ISO-8601 formatted string into Date object. + :param str attr: response string to be deserialized. + :rtype: date + :returns: The date object from that input + """ + # This must NOT use defaultmonth/defaultday. Using None ensure this raises an exception. + if isinstance(attr, date): + return attr + return isodate.parse_date(attr, defaultmonth=None, defaultday=None) # type: ignore + + +def _deserialize_time(attr: typing.Union[str, time]) -> time: + """Deserialize ISO-8601 formatted string into time object. + + :param str attr: response string to be deserialized. + :rtype: datetime.time + :returns: The time object from that input + """ + if isinstance(attr, time): + return attr + return isodate.parse_time(attr) + + +def _deserialize_bytes(attr): + if isinstance(attr, (bytes, bytearray)): + return attr + return bytes(base64.b64decode(attr)) + + +def _deserialize_bytes_base64(attr): + if isinstance(attr, (bytes, bytearray)): + return attr + padding = "=" * (3 - (len(attr) + 3) % 4) # type: ignore + attr = attr + padding # type: ignore + encoded = attr.replace("-", "+").replace("_", "/") + return bytes(base64.b64decode(encoded)) + + +def _deserialize_duration(attr): + if isinstance(attr, timedelta): + return attr + return isodate.parse_duration(attr) + + +def _deserialize_decimal(attr): + if isinstance(attr, decimal.Decimal): + return attr + return decimal.Decimal(str(attr)) + + +_DESERIALIZE_MAPPING = { + datetime: _deserialize_datetime, + date: _deserialize_date, + time: _deserialize_time, + bytes: _deserialize_bytes, + bytearray: _deserialize_bytes, + timedelta: _deserialize_duration, + typing.Any: lambda x: x, + decimal.Decimal: _deserialize_decimal, +} + +_DESERIALIZE_MAPPING_WITHFORMAT = { + "rfc3339": _deserialize_datetime, + "rfc7231": _deserialize_datetime_rfc7231, + "unix-timestamp": _deserialize_datetime_unix_timestamp, + "base64": _deserialize_bytes, + "base64url": _deserialize_bytes_base64, +} + + +def get_deserializer(annotation: typing.Any, rf: typing.Optional["_RestField"] = None): + if rf and rf._format: + return _DESERIALIZE_MAPPING_WITHFORMAT.get(rf._format) + return _DESERIALIZE_MAPPING.get(annotation) + + +def _get_type_alias_type(module_name: str, alias_name: str): + types = { + k: v + for k, v in sys.modules[module_name].__dict__.items() + if isinstance(v, typing._GenericAlias) # type: ignore + } + if alias_name not in types: + return alias_name + return types[alias_name] + + +def _get_model(module_name: str, model_name: str): + models = {k: v for k, v in sys.modules[module_name].__dict__.items() if isinstance(v, type)} + module_end = module_name.rsplit(".", 1)[0] + models.update({k: v for k, v in sys.modules[module_end].__dict__.items() if isinstance(v, type)}) + if isinstance(model_name, str): + model_name = model_name.split(".")[-1] + if model_name not in models: + return model_name + return models[model_name] + + +_UNSET = object() + + +class _MyMutableMapping(MutableMapping[str, typing.Any]): # pylint: disable=unsubscriptable-object + def __init__(self, data: typing.Dict[str, typing.Any]) -> None: + self._data = data + + def __contains__(self, key: typing.Any) -> bool: + return key in self._data + + def __getitem__(self, key: str) -> typing.Any: + return self._data.__getitem__(key) + + def __setitem__(self, key: str, value: typing.Any) -> None: + self._data.__setitem__(key, value) + + def __delitem__(self, key: str) -> None: + self._data.__delitem__(key) + + def __iter__(self) -> typing.Iterator[typing.Any]: + return self._data.__iter__() + + def __len__(self) -> int: + return self._data.__len__() + + def __ne__(self, other: typing.Any) -> bool: + return not self.__eq__(other) + + def keys(self) -> typing.KeysView[str]: + return self._data.keys() + + def values(self) -> typing.ValuesView[typing.Any]: + return self._data.values() + + def items(self) -> typing.ItemsView[str, typing.Any]: + return self._data.items() + + def get(self, key: str, default: typing.Any = None) -> typing.Any: + try: + return self[key] + except KeyError: + return default + + @typing.overload + def pop(self, key: str) -> typing.Any: ... + + @typing.overload + def pop(self, key: str, default: _T) -> _T: ... + + @typing.overload + def pop(self, key: str, default: typing.Any) -> typing.Any: ... + + def pop(self, key: str, default: typing.Any = _UNSET) -> typing.Any: + if default is _UNSET: + return self._data.pop(key) + return self._data.pop(key, default) + + def popitem(self) -> typing.Tuple[str, typing.Any]: + return self._data.popitem() + + def clear(self) -> None: + self._data.clear() + + def update(self, *args: typing.Any, **kwargs: typing.Any) -> None: + self._data.update(*args, **kwargs) + + @typing.overload + def setdefault(self, key: str, default: None = None) -> None: ... + + @typing.overload + def setdefault(self, key: str, default: typing.Any) -> typing.Any: ... + + def setdefault(self, key: str, default: typing.Any = _UNSET) -> typing.Any: + if default is _UNSET: + return self._data.setdefault(key) + return self._data.setdefault(key, default) + + def __eq__(self, other: typing.Any) -> bool: + try: + other_model = self.__class__(other) + except Exception: + return False + return self._data == other_model._data + + def __repr__(self) -> str: + return str(self._data) + + +def _is_model(obj: typing.Any) -> bool: + return getattr(obj, "_is_model", False) + + +def _serialize(o, format: typing.Optional[str] = None): # pylint: disable=too-many-return-statements + if isinstance(o, list): + return [_serialize(x, format) for x in o] + if isinstance(o, dict): + return {k: _serialize(v, format) for k, v in o.items()} + if isinstance(o, set): + return {_serialize(x, format) for x in o} + if isinstance(o, tuple): + return tuple(_serialize(x, format) for x in o) + if isinstance(o, (bytes, bytearray)): + return _serialize_bytes(o, format) + if isinstance(o, decimal.Decimal): + return float(o) + if isinstance(o, enum.Enum): + return o.value + if isinstance(o, int): + if format == "str": + return str(o) + return o + try: + # First try datetime.datetime + return _serialize_datetime(o, format) + except AttributeError: + pass + # Last, try datetime.timedelta + try: + return _timedelta_as_isostr(o) + except AttributeError: + # This will be raised when it hits value.total_seconds in the method above + pass + return o + + +def _get_rest_field( + attr_to_rest_field: typing.Dict[str, "_RestField"], rest_name: str +) -> typing.Optional["_RestField"]: + try: + return next(rf for rf in attr_to_rest_field.values() if rf._rest_name == rest_name) + except StopIteration: + return None + + +def _create_value(rf: typing.Optional["_RestField"], value: typing.Any) -> typing.Any: + if not rf: + return _serialize(value, None) + if rf._is_multipart_file_input: + return value + if rf._is_model: + return _deserialize(rf._type, value) + return _serialize(value, rf._format) + + +class Model(_MyMutableMapping): + _is_model = True + # label whether current class's _attr_to_rest_field has been calculated + # could not see _attr_to_rest_field directly because subclass inherits it from parent class + _calculated: typing.Set[str] = set() + + def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None: + class_name = self.__class__.__name__ + if len(args) > 1: + raise TypeError(f"{class_name}.__init__() takes 2 positional arguments but {len(args) + 1} were given") + dict_to_pass = { + rest_field._rest_name: rest_field._default + for rest_field in self._attr_to_rest_field.values() + if rest_field._default is not _UNSET + } + if args: + dict_to_pass.update( + {k: _create_value(_get_rest_field(self._attr_to_rest_field, k), v) for k, v in args[0].items()} + ) + else: + non_attr_kwargs = [k for k in kwargs if k not in self._attr_to_rest_field] + if non_attr_kwargs: + # actual type errors only throw the first wrong keyword arg they see, so following that. + raise TypeError(f"{class_name}.__init__() got an unexpected keyword argument '{non_attr_kwargs[0]}'") + dict_to_pass.update( + { + self._attr_to_rest_field[k]._rest_name: _create_value(self._attr_to_rest_field[k], v) + for k, v in kwargs.items() + if v is not None + } + ) + super().__init__(dict_to_pass) + + def copy(self) -> "Model": + return Model(self.__dict__) + + def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: # pylint: disable=unused-argument + if f"{cls.__module__}.{cls.__qualname__}" not in cls._calculated: + # we know the last nine classes in mro are going to be 'Model', '_MyMutableMapping', 'MutableMapping', + # 'Mapping', 'Collection', 'Sized', 'Iterable', 'Container' and 'object' + mros = cls.__mro__[:-9][::-1] # ignore parents, and reverse the mro order + attr_to_rest_field: typing.Dict[str, _RestField] = { # map attribute name to rest_field property + k: v for mro_class in mros for k, v in mro_class.__dict__.items() if k[0] != "_" and hasattr(v, "_type") + } + annotations = { + k: v + for mro_class in mros + if hasattr(mro_class, "__annotations__") # pylint: disable=no-member + for k, v in mro_class.__annotations__.items() # pylint: disable=no-member + } + for attr, rf in attr_to_rest_field.items(): + rf._module = cls.__module__ + if not rf._type: + rf._type = rf._get_deserialize_callable_from_annotation(annotations.get(attr, None)) + if not rf._rest_name_input: + rf._rest_name_input = attr + cls._attr_to_rest_field: typing.Dict[str, _RestField] = dict(attr_to_rest_field.items()) + cls._calculated.add(f"{cls.__module__}.{cls.__qualname__}") + + return super().__new__(cls) # pylint: disable=no-value-for-parameter + + def __init_subclass__(cls, discriminator: typing.Optional[str] = None) -> None: + for base in cls.__bases__: + if hasattr(base, "__mapping__"): # pylint: disable=no-member + base.__mapping__[discriminator or cls.__name__] = cls # type: ignore # pylint: disable=no-member + + @classmethod + def _get_discriminator(cls, exist_discriminators) -> typing.Optional[str]: + for v in cls.__dict__.values(): + if ( + isinstance(v, _RestField) and v._is_discriminator and v._rest_name not in exist_discriminators + ): # pylint: disable=protected-access + return v._rest_name # pylint: disable=protected-access + return None + + @classmethod + def _deserialize(cls, data, exist_discriminators): + if not hasattr(cls, "__mapping__"): # pylint: disable=no-member + return cls(data) + discriminator = cls._get_discriminator(exist_discriminators) + exist_discriminators.append(discriminator) + mapped_cls = cls.__mapping__.get(data.get(discriminator), cls) # pyright: ignore # pylint: disable=no-member + if mapped_cls == cls: + return cls(data) + return mapped_cls._deserialize(data, exist_discriminators) # pylint: disable=protected-access + + def as_dict(self, *, exclude_readonly: bool = False) -> typing.Dict[str, typing.Any]: + """Return a dict that can be JSONify using json.dump. + + :keyword bool exclude_readonly: Whether to remove the readonly properties. + :returns: A dict JSON compatible object + :rtype: dict + """ + + result = {} + readonly_props = [] + if exclude_readonly: + readonly_props = [p._rest_name for p in self._attr_to_rest_field.values() if _is_readonly(p)] + for k, v in self.items(): + if exclude_readonly and k in readonly_props: # pyright: ignore + continue + is_multipart_file_input = False + try: + is_multipart_file_input = next( + rf for rf in self._attr_to_rest_field.values() if rf._rest_name == k + )._is_multipart_file_input + except StopIteration: + pass + result[k] = v if is_multipart_file_input else Model._as_dict_value(v, exclude_readonly=exclude_readonly) + return result + + @staticmethod + def _as_dict_value(v: typing.Any, exclude_readonly: bool = False) -> typing.Any: + if v is None or isinstance(v, _Null): + return None + if isinstance(v, (list, tuple, set)): + return type(v)(Model._as_dict_value(x, exclude_readonly=exclude_readonly) for x in v) + if isinstance(v, dict): + return {dk: Model._as_dict_value(dv, exclude_readonly=exclude_readonly) for dk, dv in v.items()} + return v.as_dict(exclude_readonly=exclude_readonly) if hasattr(v, "as_dict") else v + + +def _deserialize_model(model_deserializer: typing.Optional[typing.Callable], obj): + if _is_model(obj): + return obj + return _deserialize(model_deserializer, obj) + + +def _deserialize_with_optional(if_obj_deserializer: typing.Optional[typing.Callable], obj): + if obj is None: + return obj + return _deserialize_with_callable(if_obj_deserializer, obj) + + +def _deserialize_with_union(deserializers, obj): + for deserializer in deserializers: + try: + return _deserialize(deserializer, obj) + except DeserializationError: + pass + raise DeserializationError() + + +def _deserialize_dict( + value_deserializer: typing.Optional[typing.Callable], + module: typing.Optional[str], + obj: typing.Dict[typing.Any, typing.Any], +): + if obj is None: + return obj + return {k: _deserialize(value_deserializer, v, module) for k, v in obj.items()} + + +def _deserialize_multiple_sequence( + entry_deserializers: typing.List[typing.Optional[typing.Callable]], + module: typing.Optional[str], + obj, +): + if obj is None: + return obj + return type(obj)(_deserialize(deserializer, entry, module) for entry, deserializer in zip(obj, entry_deserializers)) + + +def _deserialize_sequence( + deserializer: typing.Optional[typing.Callable], + module: typing.Optional[str], + obj, +): + if obj is None: + return obj + return type(obj)(_deserialize(deserializer, entry, module) for entry in obj) + + +def _sorted_annotations(types: typing.List[typing.Any]) -> typing.List[typing.Any]: + return sorted( + types, + key=lambda x: hasattr(x, "__name__") and x.__name__.lower() in ("str", "float", "int", "bool"), + ) + + +def _get_deserialize_callable_from_annotation( # pylint: disable=R0911, R0915, R0912 + annotation: typing.Any, + module: typing.Optional[str], + rf: typing.Optional["_RestField"] = None, +) -> typing.Optional[typing.Callable[[typing.Any], typing.Any]]: + if not annotation or annotation in [int, float]: + if annotation is int and rf and rf._format == "str": + return int + return None + + # is it a type alias? + if isinstance(annotation, str): + if module is not None: + annotation = _get_type_alias_type(module, annotation) + + # is it a forward ref / in quotes? + if isinstance(annotation, (str, typing.ForwardRef)): + try: + model_name = annotation.__forward_arg__ # type: ignore + except AttributeError: + model_name = annotation + if module is not None: + annotation = _get_model(module, model_name) + + try: + if module and _is_model(annotation): + if rf: + rf._is_model = True + + return functools.partial(_deserialize_model, annotation) # pyright: ignore + except Exception: + pass + + # is it a literal? + try: + if annotation.__origin__ is typing.Literal: # pyright: ignore + return None + except AttributeError: + pass + + # is it optional? + try: + if any(a for a in annotation.__args__ if a == type(None)): # pyright: ignore + if len(annotation.__args__) <= 2: # pyright: ignore + if_obj_deserializer = _get_deserialize_callable_from_annotation( + next(a for a in annotation.__args__ if a != type(None)), module, rf # pyright: ignore + ) + + return functools.partial(_deserialize_with_optional, if_obj_deserializer) + # the type is Optional[Union[...]], we need to remove the None type from the Union + annotation_copy = copy.copy(annotation) + annotation_copy.__args__ = [a for a in annotation_copy.__args__ if a != type(None)] # pyright: ignore + return _get_deserialize_callable_from_annotation(annotation_copy, module, rf) + except AttributeError: + pass + + # is it union? + if getattr(annotation, "__origin__", None) is typing.Union: + # initial ordering is we make `string` the last deserialization option, because it is often them most generic + deserializers = [ + _get_deserialize_callable_from_annotation(arg, module, rf) + for arg in _sorted_annotations(annotation.__args__) # pyright: ignore + ] + + return functools.partial(_deserialize_with_union, deserializers) + + try: + if annotation._name == "Dict": # pyright: ignore + value_deserializer = _get_deserialize_callable_from_annotation( + annotation.__args__[1], module, rf # pyright: ignore + ) + + return functools.partial( + _deserialize_dict, + value_deserializer, + module, + ) + except (AttributeError, IndexError): + pass + try: + if annotation._name in ["List", "Set", "Tuple", "Sequence"]: # pyright: ignore + if len(annotation.__args__) > 1: # pyright: ignore + + entry_deserializers = [ + _get_deserialize_callable_from_annotation(dt, module, rf) + for dt in annotation.__args__ # pyright: ignore + ] + return functools.partial(_deserialize_multiple_sequence, entry_deserializers, module) + deserializer = _get_deserialize_callable_from_annotation( + annotation.__args__[0], module, rf # pyright: ignore + ) + + return functools.partial(_deserialize_sequence, deserializer, module) + except (TypeError, IndexError, AttributeError, SyntaxError): + pass + + def _deserialize_default( + deserializer, + obj, + ): + if obj is None: + return obj + try: + return _deserialize_with_callable(deserializer, obj) + except Exception: + pass + return obj + + if get_deserializer(annotation, rf): + return functools.partial(_deserialize_default, get_deserializer(annotation, rf)) + + return functools.partial(_deserialize_default, annotation) + + +def _deserialize_with_callable( + deserializer: typing.Optional[typing.Callable[[typing.Any], typing.Any]], + value: typing.Any, +): + try: + if value is None or isinstance(value, _Null): + return None + if deserializer is None: + return value + if isinstance(deserializer, CaseInsensitiveEnumMeta): + try: + return deserializer(value) + except ValueError: + # for unknown value, return raw value + return value + if isinstance(deserializer, type) and issubclass(deserializer, Model): + return deserializer._deserialize(value, []) + return typing.cast(typing.Callable[[typing.Any], typing.Any], deserializer)(value) + except Exception as e: + raise DeserializationError() from e + + +def _deserialize( + deserializer: typing.Any, + value: typing.Any, + module: typing.Optional[str] = None, + rf: typing.Optional["_RestField"] = None, + format: typing.Optional[str] = None, +) -> typing.Any: + if isinstance(value, PipelineResponse): + value = value.http_response.json() + if rf is None and format: + rf = _RestField(format=format) + if not isinstance(deserializer, functools.partial): + deserializer = _get_deserialize_callable_from_annotation(deserializer, module, rf) + return _deserialize_with_callable(deserializer, value) + + +class _RestField: + def __init__( + self, + *, + name: typing.Optional[str] = None, + type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin + is_discriminator: bool = False, + visibility: typing.Optional[typing.List[str]] = None, + default: typing.Any = _UNSET, + format: typing.Optional[str] = None, + is_multipart_file_input: bool = False, + ): + self._type = type + self._rest_name_input = name + self._module: typing.Optional[str] = None + self._is_discriminator = is_discriminator + self._visibility = visibility + self._is_model = False + self._default = default + self._format = format + self._is_multipart_file_input = is_multipart_file_input + + @property + def _class_type(self) -> typing.Any: + return getattr(self._type, "args", [None])[0] + + @property + def _rest_name(self) -> str: + if self._rest_name_input is None: + raise ValueError("Rest name was never set") + return self._rest_name_input + + def __get__(self, obj: Model, type=None): # pylint: disable=redefined-builtin + # by this point, type and rest_name will have a value bc we default + # them in __new__ of the Model class + item = obj.get(self._rest_name) + if item is None: + return item + if self._is_model: + return item + return _deserialize(self._type, _serialize(item, self._format), rf=self) + + def __set__(self, obj: Model, value) -> None: + if value is None: + # we want to wipe out entries if users set attr to None + try: + obj.__delitem__(self._rest_name) + except KeyError: + pass + return + if self._is_model: + if not _is_model(value): + value = _deserialize(self._type, value) + obj.__setitem__(self._rest_name, value) + return + obj.__setitem__(self._rest_name, _serialize(value, self._format)) + + def _get_deserialize_callable_from_annotation( + self, annotation: typing.Any + ) -> typing.Optional[typing.Callable[[typing.Any], typing.Any]]: + return _get_deserialize_callable_from_annotation(annotation, self._module, self) + + +def rest_field( + *, + name: typing.Optional[str] = None, + type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin + visibility: typing.Optional[typing.List[str]] = None, + default: typing.Any = _UNSET, + format: typing.Optional[str] = None, + is_multipart_file_input: bool = False, +) -> typing.Any: + return _RestField( + name=name, + type=type, + visibility=visibility, + default=default, + format=format, + is_multipart_file_input=is_multipart_file_input, + ) + + +def rest_discriminator( + *, + name: typing.Optional[str] = None, + type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin + visibility: typing.Optional[typing.List[str]] = None, +) -> typing.Any: + return _RestField(name=name, type=type, is_discriminator=True, visibility=visibility) diff --git a/packages/typespec-python/test/azure/generated/routes/routes/_patch.py b/packages/typespec-python/test/azure/generated/routes/routes/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/routes/routes/_serialization.py b/packages/typespec-python/test/azure/generated/routes/routes/_serialization.py new file mode 100644 index 00000000000..01a226bd7f1 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/_serialization.py @@ -0,0 +1,2115 @@ +# pylint: disable=too-many-lines +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# pyright: reportUnnecessaryTypeIgnoreComment=false + +from base64 import b64decode, b64encode +import calendar +import datetime +import decimal +import email +from enum import Enum +import json +import logging +import re +import sys +import codecs +from typing import ( + Dict, + Any, + cast, + Optional, + Union, + AnyStr, + IO, + Mapping, + Callable, + TypeVar, + MutableMapping, + Type, + List, +) + +try: + from urllib import quote # type: ignore +except ImportError: + from urllib.parse import quote +import xml.etree.ElementTree as ET + +import isodate # type: ignore + +from azure.core.exceptions import DeserializationError, SerializationError +from azure.core.serialization import NULL as CoreNull + +_BOM = codecs.BOM_UTF8.decode(encoding="utf-8") + +ModelType = TypeVar("ModelType", bound="Model") +JSON = MutableMapping[str, Any] + + +class RawDeserializer: + + # Accept "text" because we're open minded people... + JSON_REGEXP = re.compile(r"^(application|text)/([a-z+.]+\+)?json$") + + # Name used in context + CONTEXT_NAME = "deserialized_data" + + @classmethod + def deserialize_from_text(cls, data: Optional[Union[AnyStr, IO]], content_type: Optional[str] = None) -> Any: + """Decode data according to content-type. + + Accept a stream of data as well, but will be load at once in memory for now. + + If no content-type, will return the string version (not bytes, not stream) + + :param data: Input, could be bytes or stream (will be decoded with UTF8) or text + :type data: str or bytes or IO + :param str content_type: The content type. + :return: The deserialized data. + :rtype: object + """ + if hasattr(data, "read"): + # Assume a stream + data = cast(IO, data).read() + + if isinstance(data, bytes): + data_as_str = data.decode(encoding="utf-8-sig") + else: + # Explain to mypy the correct type. + data_as_str = cast(str, data) + + # Remove Byte Order Mark if present in string + data_as_str = data_as_str.lstrip(_BOM) + + if content_type is None: + return data + + if cls.JSON_REGEXP.match(content_type): + try: + return json.loads(data_as_str) + except ValueError as err: + raise DeserializationError("JSON is invalid: {}".format(err), err) from err + elif "xml" in (content_type or []): + try: + + try: + if isinstance(data, unicode): # type: ignore + # If I'm Python 2.7 and unicode XML will scream if I try a "fromstring" on unicode string + data_as_str = data_as_str.encode(encoding="utf-8") # type: ignore + except NameError: + pass + + return ET.fromstring(data_as_str) # nosec + except ET.ParseError as err: + # It might be because the server has an issue, and returned JSON with + # content-type XML.... + # So let's try a JSON load, and if it's still broken + # let's flow the initial exception + def _json_attemp(data): + try: + return True, json.loads(data) + except ValueError: + return False, None # Don't care about this one + + success, json_result = _json_attemp(data) + if success: + return json_result + # If i'm here, it's not JSON, it's not XML, let's scream + # and raise the last context in this block (the XML exception) + # The function hack is because Py2.7 messes up with exception + # context otherwise. + _LOGGER.critical("Wasn't XML not JSON, failing") + raise DeserializationError("XML is invalid") from err + elif content_type.startswith("text/"): + return data_as_str + raise DeserializationError("Cannot deserialize content-type: {}".format(content_type)) + + @classmethod + def deserialize_from_http_generics(cls, body_bytes: Optional[Union[AnyStr, IO]], headers: Mapping) -> Any: + """Deserialize from HTTP response. + + Use bytes and headers to NOT use any requests/aiohttp or whatever + specific implementation. + Headers will tested for "content-type" + + :param bytes body_bytes: The body of the response. + :param dict headers: The headers of the response. + :returns: The deserialized data. + :rtype: object + """ + # Try to use content-type from headers if available + content_type = None + if "content-type" in headers: + content_type = headers["content-type"].split(";")[0].strip().lower() + # Ouch, this server did not declare what it sent... + # Let's guess it's JSON... + # Also, since Autorest was considering that an empty body was a valid JSON, + # need that test as well.... + else: + content_type = "application/json" + + if body_bytes: + return cls.deserialize_from_text(body_bytes, content_type) + return None + + +_LOGGER = logging.getLogger(__name__) + +try: + _long_type = long # type: ignore +except NameError: + _long_type = int + + +class UTC(datetime.tzinfo): + """Time Zone info for handling UTC""" + + def utcoffset(self, dt): + """UTF offset for UTC is 0. + + :param datetime.datetime dt: The datetime + :returns: The offset + :rtype: datetime.timedelta + """ + return datetime.timedelta(0) + + def tzname(self, dt): + """Timestamp representation. + + :param datetime.datetime dt: The datetime + :returns: The timestamp representation + :rtype: str + """ + return "Z" + + def dst(self, dt): + """No daylight saving for UTC. + + :param datetime.datetime dt: The datetime + :returns: The daylight saving time + :rtype: datetime.timedelta + """ + return datetime.timedelta(hours=1) + + +try: + from datetime import timezone as _FixedOffset # type: ignore +except ImportError: # Python 2.7 + + class _FixedOffset(datetime.tzinfo): # type: ignore + """Fixed offset in minutes east from UTC. + Copy/pasted from Python doc + :param datetime.timedelta offset: offset in timedelta format + """ + + def __init__(self, offset): + self.__offset = offset + + def utcoffset(self, dt): + return self.__offset + + def tzname(self, dt): + return str(self.__offset.total_seconds() / 3600) + + def __repr__(self): + return "".format(self.tzname(None)) + + def dst(self, dt): + return datetime.timedelta(0) + + def __getinitargs__(self): + return (self.__offset,) + + +try: + from datetime import timezone + + TZ_UTC = timezone.utc +except ImportError: + TZ_UTC = UTC() # type: ignore + +_FLATTEN = re.compile(r"(? None: + self.additional_properties: Optional[Dict[str, Any]] = {} + for k in kwargs: # pylint: disable=consider-using-dict-items + if k not in self._attribute_map: + _LOGGER.warning("%s is not a known attribute of class %s and will be ignored", k, self.__class__) + elif k in self._validation and self._validation[k].get("readonly", False): + _LOGGER.warning("Readonly attribute %s will be ignored in class %s", k, self.__class__) + else: + setattr(self, k, kwargs[k]) + + def __eq__(self, other: Any) -> bool: + """Compare objects by comparing all attributes. + + :param object other: The object to compare + :returns: True if objects are equal + :rtype: bool + """ + if isinstance(other, self.__class__): + return self.__dict__ == other.__dict__ + return False + + def __ne__(self, other: Any) -> bool: + """Compare objects by comparing all attributes. + + :param object other: The object to compare + :returns: True if objects are not equal + :rtype: bool + """ + return not self.__eq__(other) + + def __str__(self) -> str: + return str(self.__dict__) + + @classmethod + def enable_additional_properties_sending(cls) -> None: + cls._attribute_map["additional_properties"] = {"key": "", "type": "{object}"} + + @classmethod + def is_xml_model(cls) -> bool: + try: + cls._xml_map # type: ignore + except AttributeError: + return False + return True + + @classmethod + def _create_xml_node(cls): + """Create XML node. + + :returns: The XML node + :rtype: xml.etree.ElementTree.Element + """ + try: + xml_map = cls._xml_map # type: ignore + except AttributeError: + xml_map = {} + + return _create_xml_node(xml_map.get("name", cls.__name__), xml_map.get("prefix", None), xml_map.get("ns", None)) + + def serialize(self, keep_readonly: bool = False, **kwargs: Any) -> JSON: + """Return the JSON that would be sent to server from this model. + + This is an alias to `as_dict(full_restapi_key_transformer, keep_readonly=False)`. + + If you want XML serialization, you can pass the kwargs is_xml=True. + + :param bool keep_readonly: If you want to serialize the readonly attributes + :returns: A dict JSON compatible object + :rtype: dict + """ + serializer = Serializer(self._infer_class_models()) + return serializer._serialize( # type: ignore # pylint: disable=protected-access + self, keep_readonly=keep_readonly, **kwargs + ) + + def as_dict( + self, + keep_readonly: bool = True, + key_transformer: Callable[[str, Dict[str, Any], Any], Any] = attribute_transformer, + **kwargs: Any + ) -> JSON: + """Return a dict that can be serialized using json.dump. + + Advanced usage might optionally use a callback as parameter: + + .. code::python + + def my_key_transformer(key, attr_desc, value): + return key + + Key is the attribute name used in Python. Attr_desc + is a dict of metadata. Currently contains 'type' with the + msrest type and 'key' with the RestAPI encoded key. + Value is the current value in this object. + + The string returned will be used to serialize the key. + If the return type is a list, this is considered hierarchical + result dict. + + See the three examples in this file: + + - attribute_transformer + - full_restapi_key_transformer + - last_restapi_key_transformer + + If you want XML serialization, you can pass the kwargs is_xml=True. + + :param bool keep_readonly: If you want to serialize the readonly attributes + :param function key_transformer: A key transformer function. + :returns: A dict JSON compatible object + :rtype: dict + """ + serializer = Serializer(self._infer_class_models()) + return serializer._serialize( # type: ignore # pylint: disable=protected-access + self, key_transformer=key_transformer, keep_readonly=keep_readonly, **kwargs + ) + + @classmethod + def _infer_class_models(cls): + try: + str_models = cls.__module__.rsplit(".", 1)[0] + models = sys.modules[str_models] + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + if cls.__name__ not in client_models: + raise ValueError("Not Autorest generated code") + except Exception: # pylint: disable=broad-exception-caught + # Assume it's not Autorest generated (tests?). Add ourselves as dependencies. + client_models = {cls.__name__: cls} + return client_models + + @classmethod + def deserialize(cls: Type[ModelType], data: Any, content_type: Optional[str] = None) -> ModelType: + """Parse a str using the RestAPI syntax and return a model. + + :param str data: A str using RestAPI structure. JSON by default. + :param str content_type: JSON by default, set application/xml if XML. + :returns: An instance of this model + :raises: DeserializationError if something went wrong + :rtype: ModelType + """ + deserializer = Deserializer(cls._infer_class_models()) + return deserializer(cls.__name__, data, content_type=content_type) # type: ignore + + @classmethod + def from_dict( + cls: Type[ModelType], + data: Any, + key_extractors: Optional[Callable[[str, Dict[str, Any], Any], Any]] = None, + content_type: Optional[str] = None, + ) -> ModelType: + """Parse a dict using given key extractor return a model. + + By default consider key + extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor + and last_rest_key_case_insensitive_extractor) + + :param dict data: A dict using RestAPI structure + :param function key_extractors: A key extractor function. + :param str content_type: JSON by default, set application/xml if XML. + :returns: An instance of this model + :raises: DeserializationError if something went wrong + :rtype: ModelType + """ + deserializer = Deserializer(cls._infer_class_models()) + deserializer.key_extractors = ( # type: ignore + [ # type: ignore + attribute_key_case_insensitive_extractor, + rest_key_case_insensitive_extractor, + last_rest_key_case_insensitive_extractor, + ] + if key_extractors is None + else key_extractors + ) + return deserializer(cls.__name__, data, content_type=content_type) # type: ignore + + @classmethod + def _flatten_subtype(cls, key, objects): + if "_subtype_map" not in cls.__dict__: + return {} + result = dict(cls._subtype_map[key]) + for valuetype in cls._subtype_map[key].values(): + result.update(objects[valuetype]._flatten_subtype(key, objects)) # pylint: disable=protected-access + return result + + @classmethod + def _classify(cls, response, objects): + """Check the class _subtype_map for any child classes. + We want to ignore any inherited _subtype_maps. + Remove the polymorphic key from the initial data. + + :param dict response: The initial data + :param dict objects: The class objects + :returns: The class to be used + :rtype: class + """ + for subtype_key in cls.__dict__.get("_subtype_map", {}).keys(): + subtype_value = None + + if not isinstance(response, ET.Element): + rest_api_response_key = cls._get_rest_key_parts(subtype_key)[-1] + subtype_value = response.pop(rest_api_response_key, None) or response.pop(subtype_key, None) + else: + subtype_value = xml_key_extractor(subtype_key, cls._attribute_map[subtype_key], response) + if subtype_value: + # Try to match base class. Can be class name only + # (bug to fix in Autorest to support x-ms-discriminator-name) + if cls.__name__ == subtype_value: + return cls + flatten_mapping_type = cls._flatten_subtype(subtype_key, objects) + try: + return objects[flatten_mapping_type[subtype_value]] # type: ignore + except KeyError: + _LOGGER.warning( + "Subtype value %s has no mapping, use base class %s.", + subtype_value, + cls.__name__, + ) + break + else: + _LOGGER.warning("Discriminator %s is absent or null, use base class %s.", subtype_key, cls.__name__) + break + return cls + + @classmethod + def _get_rest_key_parts(cls, attr_key): + """Get the RestAPI key of this attr, split it and decode part + :param str attr_key: Attribute key must be in attribute_map. + :returns: A list of RestAPI part + :rtype: list + """ + rest_split_key = _FLATTEN.split(cls._attribute_map[attr_key]["key"]) + return [_decode_attribute_map_key(key_part) for key_part in rest_split_key] + + +def _decode_attribute_map_key(key): + """This decode a key in an _attribute_map to the actual key we want to look at + inside the received data. + + :param str key: A key string from the generated code + :returns: The decoded key + :rtype: str + """ + return key.replace("\\.", ".") + + +class Serializer(object): # pylint: disable=too-many-public-methods + """Request object model serializer.""" + + basic_types = {str: "str", int: "int", bool: "bool", float: "float"} + + _xml_basic_types_serializers = {"bool": lambda x: str(x).lower()} + days = {0: "Mon", 1: "Tue", 2: "Wed", 3: "Thu", 4: "Fri", 5: "Sat", 6: "Sun"} + months = { + 1: "Jan", + 2: "Feb", + 3: "Mar", + 4: "Apr", + 5: "May", + 6: "Jun", + 7: "Jul", + 8: "Aug", + 9: "Sep", + 10: "Oct", + 11: "Nov", + 12: "Dec", + } + validation = { + "min_length": lambda x, y: len(x) < y, + "max_length": lambda x, y: len(x) > y, + "minimum": lambda x, y: x < y, + "maximum": lambda x, y: x > y, + "minimum_ex": lambda x, y: x <= y, + "maximum_ex": lambda x, y: x >= y, + "min_items": lambda x, y: len(x) < y, + "max_items": lambda x, y: len(x) > y, + "pattern": lambda x, y: not re.match(y, x, re.UNICODE), + "unique": lambda x, y: len(x) != len(set(x)), + "multiple": lambda x, y: x % y != 0, + } + + def __init__(self, classes: Optional[Mapping[str, type]] = None): + self.serialize_type = { + "iso-8601": Serializer.serialize_iso, + "rfc-1123": Serializer.serialize_rfc, + "unix-time": Serializer.serialize_unix, + "duration": Serializer.serialize_duration, + "date": Serializer.serialize_date, + "time": Serializer.serialize_time, + "decimal": Serializer.serialize_decimal, + "long": Serializer.serialize_long, + "bytearray": Serializer.serialize_bytearray, + "base64": Serializer.serialize_base64, + "object": self.serialize_object, + "[]": self.serialize_iter, + "{}": self.serialize_dict, + } + self.dependencies: Dict[str, type] = dict(classes) if classes else {} + self.key_transformer = full_restapi_key_transformer + self.client_side_validation = True + + def _serialize( # pylint: disable=too-many-nested-blocks, too-many-branches, too-many-statements, too-many-locals + self, target_obj, data_type=None, **kwargs + ): + """Serialize data into a string according to type. + + :param object target_obj: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str, dict + :raises: SerializationError if serialization fails. + :returns: The serialized data. + """ + key_transformer = kwargs.get("key_transformer", self.key_transformer) + keep_readonly = kwargs.get("keep_readonly", False) + if target_obj is None: + return None + + attr_name = None + class_name = target_obj.__class__.__name__ + + if data_type: + return self.serialize_data(target_obj, data_type, **kwargs) + + if not hasattr(target_obj, "_attribute_map"): + data_type = type(target_obj).__name__ + if data_type in self.basic_types.values(): + return self.serialize_data(target_obj, data_type, **kwargs) + + # Force "is_xml" kwargs if we detect a XML model + try: + is_xml_model_serialization = kwargs["is_xml"] + except KeyError: + is_xml_model_serialization = kwargs.setdefault("is_xml", target_obj.is_xml_model()) + + serialized = {} + if is_xml_model_serialization: + serialized = target_obj._create_xml_node() # pylint: disable=protected-access + try: + attributes = target_obj._attribute_map # pylint: disable=protected-access + for attr, attr_desc in attributes.items(): + attr_name = attr + if not keep_readonly and target_obj._validation.get( # pylint: disable=protected-access + attr_name, {} + ).get("readonly", False): + continue + + if attr_name == "additional_properties" and attr_desc["key"] == "": + if target_obj.additional_properties is not None: + serialized.update(target_obj.additional_properties) + continue + try: + + orig_attr = getattr(target_obj, attr) + if is_xml_model_serialization: + pass # Don't provide "transformer" for XML for now. Keep "orig_attr" + else: # JSON + keys, orig_attr = key_transformer(attr, attr_desc.copy(), orig_attr) + keys = keys if isinstance(keys, list) else [keys] + + kwargs["serialization_ctxt"] = attr_desc + new_attr = self.serialize_data(orig_attr, attr_desc["type"], **kwargs) + + if is_xml_model_serialization: + xml_desc = attr_desc.get("xml", {}) + xml_name = xml_desc.get("name", attr_desc["key"]) + xml_prefix = xml_desc.get("prefix", None) + xml_ns = xml_desc.get("ns", None) + if xml_desc.get("attr", False): + if xml_ns: + ET.register_namespace(xml_prefix, xml_ns) + xml_name = "{{{}}}{}".format(xml_ns, xml_name) + serialized.set(xml_name, new_attr) # type: ignore + continue + if xml_desc.get("text", False): + serialized.text = new_attr # type: ignore + continue + if isinstance(new_attr, list): + serialized.extend(new_attr) # type: ignore + elif isinstance(new_attr, ET.Element): + # If the down XML has no XML/Name, + # we MUST replace the tag with the local tag. But keeping the namespaces. + if "name" not in getattr(orig_attr, "_xml_map", {}): + splitted_tag = new_attr.tag.split("}") + if len(splitted_tag) == 2: # Namespace + new_attr.tag = "}".join([splitted_tag[0], xml_name]) + else: + new_attr.tag = xml_name + serialized.append(new_attr) # type: ignore + else: # That's a basic type + # Integrate namespace if necessary + local_node = _create_xml_node(xml_name, xml_prefix, xml_ns) + local_node.text = str(new_attr) + serialized.append(local_node) # type: ignore + else: # JSON + for k in reversed(keys): # type: ignore + new_attr = {k: new_attr} + + _new_attr = new_attr + _serialized = serialized + for k in keys: # type: ignore + if k not in _serialized: + _serialized.update(_new_attr) # type: ignore + _new_attr = _new_attr[k] # type: ignore + _serialized = _serialized[k] + except ValueError as err: + if isinstance(err, SerializationError): + raise + + except (AttributeError, KeyError, TypeError) as err: + msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj)) + raise SerializationError(msg) from err + return serialized + + def body(self, data, data_type, **kwargs): + """Serialize data intended for a request body. + + :param object data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: dict + :raises: SerializationError if serialization fails. + :raises: ValueError if data is None + :returns: The serialized request body + """ + + # Just in case this is a dict + internal_data_type_str = data_type.strip("[]{}") + internal_data_type = self.dependencies.get(internal_data_type_str, None) + try: + is_xml_model_serialization = kwargs["is_xml"] + except KeyError: + if internal_data_type and issubclass(internal_data_type, Model): + is_xml_model_serialization = kwargs.setdefault("is_xml", internal_data_type.is_xml_model()) + else: + is_xml_model_serialization = False + if internal_data_type and not isinstance(internal_data_type, Enum): + try: + deserializer = Deserializer(self.dependencies) + # Since it's on serialization, it's almost sure that format is not JSON REST + # We're not able to deal with additional properties for now. + deserializer.additional_properties_detection = False + if is_xml_model_serialization: + deserializer.key_extractors = [ # type: ignore + attribute_key_case_insensitive_extractor, + ] + else: + deserializer.key_extractors = [ + rest_key_case_insensitive_extractor, + attribute_key_case_insensitive_extractor, + last_rest_key_case_insensitive_extractor, + ] + data = deserializer._deserialize(data_type, data) # pylint: disable=protected-access + except DeserializationError as err: + raise SerializationError("Unable to build a model: " + str(err)) from err + + return self._serialize(data, data_type, **kwargs) + + def url(self, name, data, data_type, **kwargs): + """Serialize data intended for a URL path. + + :param str name: The name of the URL path parameter. + :param object data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str + :returns: The serialized URL path + :raises: TypeError if serialization fails. + :raises: ValueError if data is None + """ + try: + output = self.serialize_data(data, data_type, **kwargs) + if data_type == "bool": + output = json.dumps(output) + + if kwargs.get("skip_quote") is True: + output = str(output) + output = output.replace("{", quote("{")).replace("}", quote("}")) + else: + output = quote(str(output), safe="") + except SerializationError as exc: + raise TypeError("{} must be type {}.".format(name, data_type)) from exc + return output + + def query(self, name, data, data_type, **kwargs): + """Serialize data intended for a URL query. + + :param str name: The name of the query parameter. + :param object data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str, list + :raises: TypeError if serialization fails. + :raises: ValueError if data is None + :returns: The serialized query parameter + """ + try: + # Treat the list aside, since we don't want to encode the div separator + if data_type.startswith("["): + internal_data_type = data_type[1:-1] + do_quote = not kwargs.get("skip_quote", False) + return self.serialize_iter(data, internal_data_type, do_quote=do_quote, **kwargs) + + # Not a list, regular serialization + output = self.serialize_data(data, data_type, **kwargs) + if data_type == "bool": + output = json.dumps(output) + if kwargs.get("skip_quote") is True: + output = str(output) + else: + output = quote(str(output), safe="") + except SerializationError as exc: + raise TypeError("{} must be type {}.".format(name, data_type)) from exc + return str(output) + + def header(self, name, data, data_type, **kwargs): + """Serialize data intended for a request header. + + :param str name: The name of the header. + :param object data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str + :raises: TypeError if serialization fails. + :raises: ValueError if data is None + :returns: The serialized header + """ + try: + if data_type in ["[str]"]: + data = ["" if d is None else d for d in data] + + output = self.serialize_data(data, data_type, **kwargs) + if data_type == "bool": + output = json.dumps(output) + except SerializationError as exc: + raise TypeError("{} must be type {}.".format(name, data_type)) from exc + return str(output) + + def serialize_data(self, data, data_type, **kwargs): + """Serialize generic data according to supplied data type. + + :param object data: The data to be serialized. + :param str data_type: The type to be serialized from. + :raises: AttributeError if required data is None. + :raises: ValueError if data is None + :raises: SerializationError if serialization fails. + :returns: The serialized data. + :rtype: str, int, float, bool, dict, list + """ + if data is None: + raise ValueError("No value for given attribute") + + try: + if data is CoreNull: + return None + if data_type in self.basic_types.values(): + return self.serialize_basic(data, data_type, **kwargs) + + if data_type in self.serialize_type: + return self.serialize_type[data_type](data, **kwargs) + + # If dependencies is empty, try with current data class + # It has to be a subclass of Enum anyway + enum_type = self.dependencies.get(data_type, data.__class__) + if issubclass(enum_type, Enum): + return Serializer.serialize_enum(data, enum_obj=enum_type) + + iter_type = data_type[0] + data_type[-1] + if iter_type in self.serialize_type: + return self.serialize_type[iter_type](data, data_type[1:-1], **kwargs) + + except (ValueError, TypeError) as err: + msg = "Unable to serialize value: {!r} as type: {!r}." + raise SerializationError(msg.format(data, data_type)) from err + return self._serialize(data, **kwargs) + + @classmethod + def _get_custom_serializers(cls, data_type, **kwargs): # pylint: disable=inconsistent-return-statements + custom_serializer = kwargs.get("basic_types_serializers", {}).get(data_type) + if custom_serializer: + return custom_serializer + if kwargs.get("is_xml", False): + return cls._xml_basic_types_serializers.get(data_type) + + @classmethod + def serialize_basic(cls, data, data_type, **kwargs): + """Serialize basic builting data type. + Serializes objects to str, int, float or bool. + + Possible kwargs: + - basic_types_serializers dict[str, callable] : If set, use the callable as serializer + - is_xml bool : If set, use xml_basic_types_serializers + + :param obj data: Object to be serialized. + :param str data_type: Type of object in the iterable. + :rtype: str, int, float, bool + :return: serialized object + """ + custom_serializer = cls._get_custom_serializers(data_type, **kwargs) + if custom_serializer: + return custom_serializer(data) + if data_type == "str": + return cls.serialize_unicode(data) + return eval(data_type)(data) # nosec # pylint: disable=eval-used + + @classmethod + def serialize_unicode(cls, data): + """Special handling for serializing unicode strings in Py2. + Encode to UTF-8 if unicode, otherwise handle as a str. + + :param str data: Object to be serialized. + :rtype: str + :return: serialized object + """ + try: # If I received an enum, return its value + return data.value + except AttributeError: + pass + + try: + if isinstance(data, unicode): # type: ignore + # Don't change it, JSON and XML ElementTree are totally able + # to serialize correctly u'' strings + return data + except NameError: + return str(data) + return str(data) + + def serialize_iter(self, data, iter_type, div=None, **kwargs): + """Serialize iterable. + + Supported kwargs: + - serialization_ctxt dict : The current entry of _attribute_map, or same format. + serialization_ctxt['type'] should be same as data_type. + - is_xml bool : If set, serialize as XML + + :param list data: Object to be serialized. + :param str iter_type: Type of object in the iterable. + :param str div: If set, this str will be used to combine the elements + in the iterable into a combined string. Default is 'None'. + Defaults to False. + :rtype: list, str + :return: serialized iterable + """ + if isinstance(data, str): + raise SerializationError("Refuse str type as a valid iter type.") + + serialization_ctxt = kwargs.get("serialization_ctxt", {}) + is_xml = kwargs.get("is_xml", False) + + serialized = [] + for d in data: + try: + serialized.append(self.serialize_data(d, iter_type, **kwargs)) + except ValueError as err: + if isinstance(err, SerializationError): + raise + serialized.append(None) + + if kwargs.get("do_quote", False): + serialized = ["" if s is None else quote(str(s), safe="") for s in serialized] + + if div: + serialized = ["" if s is None else str(s) for s in serialized] + serialized = div.join(serialized) + + if "xml" in serialization_ctxt or is_xml: + # XML serialization is more complicated + xml_desc = serialization_ctxt.get("xml", {}) + xml_name = xml_desc.get("name") + if not xml_name: + xml_name = serialization_ctxt["key"] + + # Create a wrap node if necessary (use the fact that Element and list have "append") + is_wrapped = xml_desc.get("wrapped", False) + node_name = xml_desc.get("itemsName", xml_name) + if is_wrapped: + final_result = _create_xml_node(xml_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) + else: + final_result = [] + # All list elements to "local_node" + for el in serialized: + if isinstance(el, ET.Element): + el_node = el + else: + el_node = _create_xml_node(node_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) + if el is not None: # Otherwise it writes "None" :-p + el_node.text = str(el) + final_result.append(el_node) + return final_result + return serialized + + def serialize_dict(self, attr, dict_type, **kwargs): + """Serialize a dictionary of objects. + + :param dict attr: Object to be serialized. + :param str dict_type: Type of object in the dictionary. + :rtype: dict + :return: serialized dictionary + """ + serialization_ctxt = kwargs.get("serialization_ctxt", {}) + serialized = {} + for key, value in attr.items(): + try: + serialized[self.serialize_unicode(key)] = self.serialize_data(value, dict_type, **kwargs) + except ValueError as err: + if isinstance(err, SerializationError): + raise + serialized[self.serialize_unicode(key)] = None + + if "xml" in serialization_ctxt: + # XML serialization is more complicated + xml_desc = serialization_ctxt["xml"] + xml_name = xml_desc["name"] + + final_result = _create_xml_node(xml_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) + for key, value in serialized.items(): + ET.SubElement(final_result, key).text = value + return final_result + + return serialized + + def serialize_object(self, attr, **kwargs): # pylint: disable=too-many-return-statements + """Serialize a generic object. + This will be handled as a dictionary. If object passed in is not + a basic type (str, int, float, dict, list) it will simply be + cast to str. + + :param dict attr: Object to be serialized. + :rtype: dict or str + :return: serialized object + """ + if attr is None: + return None + if isinstance(attr, ET.Element): + return attr + obj_type = type(attr) + if obj_type in self.basic_types: + return self.serialize_basic(attr, self.basic_types[obj_type], **kwargs) + if obj_type is _long_type: + return self.serialize_long(attr) + if obj_type is str: + return self.serialize_unicode(attr) + if obj_type is datetime.datetime: + return self.serialize_iso(attr) + if obj_type is datetime.date: + return self.serialize_date(attr) + if obj_type is datetime.time: + return self.serialize_time(attr) + if obj_type is datetime.timedelta: + return self.serialize_duration(attr) + if obj_type is decimal.Decimal: + return self.serialize_decimal(attr) + + # If it's a model or I know this dependency, serialize as a Model + if obj_type in self.dependencies.values() or isinstance(attr, Model): + return self._serialize(attr) + + if obj_type == dict: + serialized = {} + for key, value in attr.items(): + try: + serialized[self.serialize_unicode(key)] = self.serialize_object(value, **kwargs) + except ValueError: + serialized[self.serialize_unicode(key)] = None + return serialized + + if obj_type == list: + serialized = [] + for obj in attr: + try: + serialized.append(self.serialize_object(obj, **kwargs)) + except ValueError: + pass + return serialized + return str(attr) + + @staticmethod + def serialize_enum(attr, enum_obj=None): + try: + result = attr.value + except AttributeError: + result = attr + try: + enum_obj(result) # type: ignore + return result + except ValueError as exc: + for enum_value in enum_obj: # type: ignore + if enum_value.value.lower() == str(attr).lower(): + return enum_value.value + error = "{!r} is not valid value for enum {!r}" + raise SerializationError(error.format(attr, enum_obj)) from exc + + @staticmethod + def serialize_bytearray(attr, **kwargs): # pylint: disable=unused-argument + """Serialize bytearray into base-64 string. + + :param str attr: Object to be serialized. + :rtype: str + :return: serialized base64 + """ + return b64encode(attr).decode() + + @staticmethod + def serialize_base64(attr, **kwargs): # pylint: disable=unused-argument + """Serialize str into base-64 string. + + :param str attr: Object to be serialized. + :rtype: str + :return: serialized base64 + """ + encoded = b64encode(attr).decode("ascii") + return encoded.strip("=").replace("+", "-").replace("/", "_") + + @staticmethod + def serialize_decimal(attr, **kwargs): # pylint: disable=unused-argument + """Serialize Decimal object to float. + + :param decimal attr: Object to be serialized. + :rtype: float + :return: serialized decimal + """ + return float(attr) + + @staticmethod + def serialize_long(attr, **kwargs): # pylint: disable=unused-argument + """Serialize long (Py2) or int (Py3). + + :param int attr: Object to be serialized. + :rtype: int/long + :return: serialized long + """ + return _long_type(attr) + + @staticmethod + def serialize_date(attr, **kwargs): # pylint: disable=unused-argument + """Serialize Date object into ISO-8601 formatted string. + + :param Date attr: Object to be serialized. + :rtype: str + :return: serialized date + """ + if isinstance(attr, str): + attr = isodate.parse_date(attr) + t = "{:04}-{:02}-{:02}".format(attr.year, attr.month, attr.day) + return t + + @staticmethod + def serialize_time(attr, **kwargs): # pylint: disable=unused-argument + """Serialize Time object into ISO-8601 formatted string. + + :param datetime.time attr: Object to be serialized. + :rtype: str + :return: serialized time + """ + if isinstance(attr, str): + attr = isodate.parse_time(attr) + t = "{:02}:{:02}:{:02}".format(attr.hour, attr.minute, attr.second) + if attr.microsecond: + t += ".{:02}".format(attr.microsecond) + return t + + @staticmethod + def serialize_duration(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into ISO-8601 formatted string. + + :param TimeDelta attr: Object to be serialized. + :rtype: str + :return: serialized duration + """ + if isinstance(attr, str): + attr = isodate.parse_duration(attr) + return isodate.duration_isoformat(attr) + + @staticmethod + def serialize_rfc(attr, **kwargs): # pylint: disable=unused-argument + """Serialize Datetime object into RFC-1123 formatted string. + + :param Datetime attr: Object to be serialized. + :rtype: str + :raises: TypeError if format invalid. + :return: serialized rfc + """ + try: + if not attr.tzinfo: + _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") + utc = attr.utctimetuple() + except AttributeError as exc: + raise TypeError("RFC1123 object must be valid Datetime object.") from exc + + return "{}, {:02} {} {:04} {:02}:{:02}:{:02} GMT".format( + Serializer.days[utc.tm_wday], + utc.tm_mday, + Serializer.months[utc.tm_mon], + utc.tm_year, + utc.tm_hour, + utc.tm_min, + utc.tm_sec, + ) + + @staticmethod + def serialize_iso(attr, **kwargs): # pylint: disable=unused-argument + """Serialize Datetime object into ISO-8601 formatted string. + + :param Datetime attr: Object to be serialized. + :rtype: str + :raises: SerializationError if format invalid. + :return: serialized iso + """ + if isinstance(attr, str): + attr = isodate.parse_datetime(attr) + try: + if not attr.tzinfo: + _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") + utc = attr.utctimetuple() + if utc.tm_year > 9999 or utc.tm_year < 1: + raise OverflowError("Hit max or min date") + + microseconds = str(attr.microsecond).rjust(6, "0").rstrip("0").ljust(3, "0") + if microseconds: + microseconds = "." + microseconds + date = "{:04}-{:02}-{:02}T{:02}:{:02}:{:02}".format( + utc.tm_year, utc.tm_mon, utc.tm_mday, utc.tm_hour, utc.tm_min, utc.tm_sec + ) + return date + microseconds + "Z" + except (ValueError, OverflowError) as err: + msg = "Unable to serialize datetime object." + raise SerializationError(msg) from err + except AttributeError as err: + msg = "ISO-8601 object must be valid Datetime object." + raise TypeError(msg) from err + + @staticmethod + def serialize_unix(attr, **kwargs): # pylint: disable=unused-argument + """Serialize Datetime object into IntTime format. + This is represented as seconds. + + :param Datetime attr: Object to be serialized. + :rtype: int + :raises: SerializationError if format invalid + :return: serialied unix + """ + if isinstance(attr, int): + return attr + try: + if not attr.tzinfo: + _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") + return int(calendar.timegm(attr.utctimetuple())) + except AttributeError as exc: + raise TypeError("Unix time object must be valid Datetime object.") from exc + + +def rest_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument + key = attr_desc["key"] + working_data = data + + while "." in key: + # Need the cast, as for some reasons "split" is typed as list[str | Any] + dict_keys = cast(List[str], _FLATTEN.split(key)) + if len(dict_keys) == 1: + key = _decode_attribute_map_key(dict_keys[0]) + break + working_key = _decode_attribute_map_key(dict_keys[0]) + working_data = working_data.get(working_key, data) + if working_data is None: + # If at any point while following flatten JSON path see None, it means + # that all properties under are None as well + return None + key = ".".join(dict_keys[1:]) + + return working_data.get(key) + + +def rest_key_case_insensitive_extractor( # pylint: disable=unused-argument, inconsistent-return-statements + attr, attr_desc, data +): + key = attr_desc["key"] + working_data = data + + while "." in key: + dict_keys = _FLATTEN.split(key) + if len(dict_keys) == 1: + key = _decode_attribute_map_key(dict_keys[0]) + break + working_key = _decode_attribute_map_key(dict_keys[0]) + working_data = attribute_key_case_insensitive_extractor(working_key, None, working_data) + if working_data is None: + # If at any point while following flatten JSON path see None, it means + # that all properties under are None as well + return None + key = ".".join(dict_keys[1:]) + + if working_data: + return attribute_key_case_insensitive_extractor(key, None, working_data) + + +def last_rest_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument + """Extract the attribute in "data" based on the last part of the JSON path key. + + :param str attr: The attribute to extract + :param dict attr_desc: The attribute description + :param dict data: The data to extract from + :rtype: object + :returns: The extracted attribute + """ + key = attr_desc["key"] + dict_keys = _FLATTEN.split(key) + return attribute_key_extractor(dict_keys[-1], None, data) + + +def last_rest_key_case_insensitive_extractor(attr, attr_desc, data): # pylint: disable=unused-argument + """Extract the attribute in "data" based on the last part of the JSON path key. + + This is the case insensitive version of "last_rest_key_extractor" + :param str attr: The attribute to extract + :param dict attr_desc: The attribute description + :param dict data: The data to extract from + :rtype: object + :returns: The extracted attribute + """ + key = attr_desc["key"] + dict_keys = _FLATTEN.split(key) + return attribute_key_case_insensitive_extractor(dict_keys[-1], None, data) + + +def attribute_key_extractor(attr, _, data): + return data.get(attr) + + +def attribute_key_case_insensitive_extractor(attr, _, data): + found_key = None + lower_attr = attr.lower() + for key in data: + if lower_attr == key.lower(): + found_key = key + break + + return data.get(found_key) + + +def _extract_name_from_internal_type(internal_type): + """Given an internal type XML description, extract correct XML name with namespace. + + :param dict internal_type: An model type + :rtype: tuple + :returns: A tuple XML name + namespace dict + """ + internal_type_xml_map = getattr(internal_type, "_xml_map", {}) + xml_name = internal_type_xml_map.get("name", internal_type.__name__) + xml_ns = internal_type_xml_map.get("ns", None) + if xml_ns: + xml_name = "{{{}}}{}".format(xml_ns, xml_name) + return xml_name + + +def xml_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument,too-many-return-statements + if isinstance(data, dict): + return None + + # Test if this model is XML ready first + if not isinstance(data, ET.Element): + return None + + xml_desc = attr_desc.get("xml", {}) + xml_name = xml_desc.get("name", attr_desc["key"]) + + # Look for a children + is_iter_type = attr_desc["type"].startswith("[") + is_wrapped = xml_desc.get("wrapped", False) + internal_type = attr_desc.get("internalType", None) + internal_type_xml_map = getattr(internal_type, "_xml_map", {}) + + # Integrate namespace if necessary + xml_ns = xml_desc.get("ns", internal_type_xml_map.get("ns", None)) + if xml_ns: + xml_name = "{{{}}}{}".format(xml_ns, xml_name) + + # If it's an attribute, that's simple + if xml_desc.get("attr", False): + return data.get(xml_name) + + # If it's x-ms-text, that's simple too + if xml_desc.get("text", False): + return data.text + + # Scenario where I take the local name: + # - Wrapped node + # - Internal type is an enum (considered basic types) + # - Internal type has no XML/Name node + if is_wrapped or (internal_type and (issubclass(internal_type, Enum) or "name" not in internal_type_xml_map)): + children = data.findall(xml_name) + # If internal type has a local name and it's not a list, I use that name + elif not is_iter_type and internal_type and "name" in internal_type_xml_map: + xml_name = _extract_name_from_internal_type(internal_type) + children = data.findall(xml_name) + # That's an array + else: + if internal_type: # Complex type, ignore itemsName and use the complex type name + items_name = _extract_name_from_internal_type(internal_type) + else: + items_name = xml_desc.get("itemsName", xml_name) + children = data.findall(items_name) + + if len(children) == 0: + if is_iter_type: + if is_wrapped: + return None # is_wrapped no node, we want None + return [] # not wrapped, assume empty list + return None # Assume it's not there, maybe an optional node. + + # If is_iter_type and not wrapped, return all found children + if is_iter_type: + if not is_wrapped: + return children + # Iter and wrapped, should have found one node only (the wrap one) + if len(children) != 1: + raise DeserializationError( + "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format( # pylint: disable=line-too-long + xml_name + ) + ) + return list(children[0]) # Might be empty list and that's ok. + + # Here it's not a itertype, we should have found one element only or empty + if len(children) > 1: + raise DeserializationError("Find several XML '{}' where it was not expected".format(xml_name)) + return children[0] + + +class Deserializer(object): + """Response object model deserializer. + + :param dict classes: Class type dictionary for deserializing complex types. + :ivar list key_extractors: Ordered list of extractors to be used by this deserializer. + """ + + basic_types = {str: "str", int: "int", bool: "bool", float: "float"} + + valid_date = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") + + def __init__(self, classes: Optional[Mapping[str, type]] = None): + self.deserialize_type = { + "iso-8601": Deserializer.deserialize_iso, + "rfc-1123": Deserializer.deserialize_rfc, + "unix-time": Deserializer.deserialize_unix, + "duration": Deserializer.deserialize_duration, + "date": Deserializer.deserialize_date, + "time": Deserializer.deserialize_time, + "decimal": Deserializer.deserialize_decimal, + "long": Deserializer.deserialize_long, + "bytearray": Deserializer.deserialize_bytearray, + "base64": Deserializer.deserialize_base64, + "object": self.deserialize_object, + "[]": self.deserialize_iter, + "{}": self.deserialize_dict, + } + self.deserialize_expected_types = { + "duration": (isodate.Duration, datetime.timedelta), + "iso-8601": (datetime.datetime), + } + self.dependencies: Dict[str, type] = dict(classes) if classes else {} + self.key_extractors = [rest_key_extractor, xml_key_extractor] + # Additional properties only works if the "rest_key_extractor" is used to + # extract the keys. Making it to work whatever the key extractor is too much + # complicated, with no real scenario for now. + # So adding a flag to disable additional properties detection. This flag should be + # used if your expect the deserialization to NOT come from a JSON REST syntax. + # Otherwise, result are unexpected + self.additional_properties_detection = True + + def __call__(self, target_obj, response_data, content_type=None): + """Call the deserializer to process a REST response. + + :param str target_obj: Target data type to deserialize to. + :param requests.Response response_data: REST response object. + :param str content_type: Swagger "produces" if available. + :raises: DeserializationError if deserialization fails. + :return: Deserialized object. + :rtype: object + """ + data = self._unpack_content(response_data, content_type) + return self._deserialize(target_obj, data) + + def _deserialize(self, target_obj, data): # pylint: disable=inconsistent-return-statements + """Call the deserializer on a model. + + Data needs to be already deserialized as JSON or XML ElementTree + + :param str target_obj: Target data type to deserialize to. + :param object data: Object to deserialize. + :raises: DeserializationError if deserialization fails. + :return: Deserialized object. + :rtype: object + """ + # This is already a model, go recursive just in case + if hasattr(data, "_attribute_map"): + constants = [name for name, config in getattr(data, "_validation", {}).items() if config.get("constant")] + try: + for attr, mapconfig in data._attribute_map.items(): # pylint: disable=protected-access + if attr in constants: + continue + value = getattr(data, attr) + if value is None: + continue + local_type = mapconfig["type"] + internal_data_type = local_type.strip("[]{}") + if internal_data_type not in self.dependencies or isinstance(internal_data_type, Enum): + continue + setattr(data, attr, self._deserialize(local_type, value)) + return data + except AttributeError: + return + + response, class_name = self._classify_target(target_obj, data) + + if isinstance(response, str): + return self.deserialize_data(data, response) + if isinstance(response, type) and issubclass(response, Enum): + return self.deserialize_enum(data, response) + + if data is None or data is CoreNull: + return data + try: + attributes = response._attribute_map # type: ignore # pylint: disable=protected-access + d_attrs = {} + for attr, attr_desc in attributes.items(): + # Check empty string. If it's not empty, someone has a real "additionalProperties"... + if attr == "additional_properties" and attr_desc["key"] == "": + continue + raw_value = None + # Enhance attr_desc with some dynamic data + attr_desc = attr_desc.copy() # Do a copy, do not change the real one + internal_data_type = attr_desc["type"].strip("[]{}") + if internal_data_type in self.dependencies: + attr_desc["internalType"] = self.dependencies[internal_data_type] + + for key_extractor in self.key_extractors: + found_value = key_extractor(attr, attr_desc, data) + if found_value is not None: + if raw_value is not None and raw_value != found_value: + msg = ( + "Ignoring extracted value '%s' from %s for key '%s'" + " (duplicate extraction, follow extractors order)" + ) + _LOGGER.warning(msg, found_value, key_extractor, attr) + continue + raw_value = found_value + + value = self.deserialize_data(raw_value, attr_desc["type"]) + d_attrs[attr] = value + except (AttributeError, TypeError, KeyError) as err: + msg = "Unable to deserialize to object: " + class_name # type: ignore + raise DeserializationError(msg) from err + additional_properties = self._build_additional_properties(attributes, data) + return self._instantiate_model(response, d_attrs, additional_properties) + + def _build_additional_properties(self, attribute_map, data): + if not self.additional_properties_detection: + return None + if "additional_properties" in attribute_map and attribute_map.get("additional_properties", {}).get("key") != "": + # Check empty string. If it's not empty, someone has a real "additionalProperties" + return None + if isinstance(data, ET.Element): + data = {el.tag: el.text for el in data} + + known_keys = { + _decode_attribute_map_key(_FLATTEN.split(desc["key"])[0]) + for desc in attribute_map.values() + if desc["key"] != "" + } + present_keys = set(data.keys()) + missing_keys = present_keys - known_keys + return {key: data[key] for key in missing_keys} + + def _classify_target(self, target, data): + """Check to see whether the deserialization target object can + be classified into a subclass. + Once classification has been determined, initialize object. + + :param str target: The target object type to deserialize to. + :param str/dict data: The response data to deserialize. + :return: The classified target object and its class name. + :rtype: tuple + """ + if target is None: + return None, None + + if isinstance(target, str): + try: + target = self.dependencies[target] + except KeyError: + return target, target + + try: + target = target._classify(data, self.dependencies) # type: ignore # pylint: disable=protected-access + except AttributeError: + pass # Target is not a Model, no classify + return target, target.__class__.__name__ # type: ignore + + def failsafe_deserialize(self, target_obj, data, content_type=None): + """Ignores any errors encountered in deserialization, + and falls back to not deserializing the object. Recommended + for use in error deserialization, as we want to return the + HttpResponseError to users, and not have them deal with + a deserialization error. + + :param str target_obj: The target object type to deserialize to. + :param str/dict data: The response data to deserialize. + :param str content_type: Swagger "produces" if available. + :return: Deserialized object. + :rtype: object + """ + try: + return self(target_obj, data, content_type=content_type) + except: # pylint: disable=bare-except + _LOGGER.debug( + "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True + ) + return None + + @staticmethod + def _unpack_content(raw_data, content_type=None): + """Extract the correct structure for deserialization. + + If raw_data is a PipelineResponse, try to extract the result of RawDeserializer. + if we can't, raise. Your Pipeline should have a RawDeserializer. + + If not a pipeline response and raw_data is bytes or string, use content-type + to decode it. If no content-type, try JSON. + + If raw_data is something else, bypass all logic and return it directly. + + :param obj raw_data: Data to be processed. + :param str content_type: How to parse if raw_data is a string/bytes. + :raises JSONDecodeError: If JSON is requested and parsing is impossible. + :raises UnicodeDecodeError: If bytes is not UTF8 + :rtype: object + :return: Unpacked content. + """ + # Assume this is enough to detect a Pipeline Response without importing it + context = getattr(raw_data, "context", {}) + if context: + if RawDeserializer.CONTEXT_NAME in context: + return context[RawDeserializer.CONTEXT_NAME] + raise ValueError("This pipeline didn't have the RawDeserializer policy; can't deserialize") + + # Assume this is enough to recognize universal_http.ClientResponse without importing it + if hasattr(raw_data, "body"): + return RawDeserializer.deserialize_from_http_generics(raw_data.text(), raw_data.headers) + + # Assume this enough to recognize requests.Response without importing it. + if hasattr(raw_data, "_content_consumed"): + return RawDeserializer.deserialize_from_http_generics(raw_data.text, raw_data.headers) + + if isinstance(raw_data, (str, bytes)) or hasattr(raw_data, "read"): + return RawDeserializer.deserialize_from_text(raw_data, content_type) # type: ignore + return raw_data + + def _instantiate_model(self, response, attrs, additional_properties=None): + """Instantiate a response model passing in deserialized args. + + :param Response response: The response model class. + :param dict attrs: The deserialized response attributes. + :param dict additional_properties: Additional properties to be set. + :rtype: Response + :return: The instantiated response model. + """ + if callable(response): + subtype = getattr(response, "_subtype_map", {}) + try: + readonly = [ + k for k, v in response._validation.items() if v.get("readonly") # pylint: disable=protected-access + ] + const = [ + k for k, v in response._validation.items() if v.get("constant") # pylint: disable=protected-access + ] + kwargs = {k: v for k, v in attrs.items() if k not in subtype and k not in readonly + const} + response_obj = response(**kwargs) + for attr in readonly: + setattr(response_obj, attr, attrs.get(attr)) + if additional_properties: + response_obj.additional_properties = additional_properties + return response_obj + except TypeError as err: + msg = "Unable to deserialize {} into model {}. ".format(kwargs, response) # type: ignore + raise DeserializationError(msg + str(err)) from err + else: + try: + for attr, value in attrs.items(): + setattr(response, attr, value) + return response + except Exception as exp: + msg = "Unable to populate response model. " + msg += "Type: {}, Error: {}".format(type(response), exp) + raise DeserializationError(msg) from exp + + def deserialize_data(self, data, data_type): # pylint: disable=too-many-return-statements + """Process data for deserialization according to data type. + + :param str data: The response string to be deserialized. + :param str data_type: The type to deserialize to. + :raises: DeserializationError if deserialization fails. + :return: Deserialized object. + :rtype: object + """ + if data is None: + return data + + try: + if not data_type: + return data + if data_type in self.basic_types.values(): + return self.deserialize_basic(data, data_type) + if data_type in self.deserialize_type: + if isinstance(data, self.deserialize_expected_types.get(data_type, tuple())): + return data + + is_a_text_parsing_type = lambda x: x not in [ # pylint: disable=unnecessary-lambda-assignment + "object", + "[]", + r"{}", + ] + if isinstance(data, ET.Element) and is_a_text_parsing_type(data_type) and not data.text: + return None + data_val = self.deserialize_type[data_type](data) + return data_val + + iter_type = data_type[0] + data_type[-1] + if iter_type in self.deserialize_type: + return self.deserialize_type[iter_type](data, data_type[1:-1]) + + obj_type = self.dependencies[data_type] + if issubclass(obj_type, Enum): + if isinstance(data, ET.Element): + data = data.text + return self.deserialize_enum(data, obj_type) + + except (ValueError, TypeError, AttributeError) as err: + msg = "Unable to deserialize response data." + msg += " Data: {}, {}".format(data, data_type) + raise DeserializationError(msg) from err + return self._deserialize(obj_type, data) + + def deserialize_iter(self, attr, iter_type): + """Deserialize an iterable. + + :param list attr: Iterable to be deserialized. + :param str iter_type: The type of object in the iterable. + :return: Deserialized iterable. + :rtype: list + """ + if attr is None: + return None + if isinstance(attr, ET.Element): # If I receive an element here, get the children + attr = list(attr) + if not isinstance(attr, (list, set)): + raise DeserializationError("Cannot deserialize as [{}] an object of type {}".format(iter_type, type(attr))) + return [self.deserialize_data(a, iter_type) for a in attr] + + def deserialize_dict(self, attr, dict_type): + """Deserialize a dictionary. + + :param dict/list attr: Dictionary to be deserialized. Also accepts + a list of key, value pairs. + :param str dict_type: The object type of the items in the dictionary. + :return: Deserialized dictionary. + :rtype: dict + """ + if isinstance(attr, list): + return {x["key"]: self.deserialize_data(x["value"], dict_type) for x in attr} + + if isinstance(attr, ET.Element): + # Transform value into {"Key": "value"} + attr = {el.tag: el.text for el in attr} + return {k: self.deserialize_data(v, dict_type) for k, v in attr.items()} + + def deserialize_object(self, attr, **kwargs): # pylint: disable=too-many-return-statements + """Deserialize a generic object. + This will be handled as a dictionary. + + :param dict attr: Dictionary to be deserialized. + :return: Deserialized object. + :rtype: dict + :raises: TypeError if non-builtin datatype encountered. + """ + if attr is None: + return None + if isinstance(attr, ET.Element): + # Do no recurse on XML, just return the tree as-is + return attr + if isinstance(attr, str): + return self.deserialize_basic(attr, "str") + obj_type = type(attr) + if obj_type in self.basic_types: + return self.deserialize_basic(attr, self.basic_types[obj_type]) + if obj_type is _long_type: + return self.deserialize_long(attr) + + if obj_type == dict: + deserialized = {} + for key, value in attr.items(): + try: + deserialized[key] = self.deserialize_object(value, **kwargs) + except ValueError: + deserialized[key] = None + return deserialized + + if obj_type == list: + deserialized = [] + for obj in attr: + try: + deserialized.append(self.deserialize_object(obj, **kwargs)) + except ValueError: + pass + return deserialized + + error = "Cannot deserialize generic object with type: " + raise TypeError(error + str(obj_type)) + + def deserialize_basic(self, attr, data_type): # pylint: disable=too-many-return-statements + """Deserialize basic builtin data type from string. + Will attempt to convert to str, int, float and bool. + This function will also accept '1', '0', 'true' and 'false' as + valid bool values. + + :param str attr: response string to be deserialized. + :param str data_type: deserialization data type. + :return: Deserialized basic type. + :rtype: str, int, float or bool + :raises: TypeError if string format is not valid. + """ + # If we're here, data is supposed to be a basic type. + # If it's still an XML node, take the text + if isinstance(attr, ET.Element): + attr = attr.text + if not attr: + if data_type == "str": + # None or '', node is empty string. + return "" + # None or '', node with a strong type is None. + # Don't try to model "empty bool" or "empty int" + return None + + if data_type == "bool": + if attr in [True, False, 1, 0]: + return bool(attr) + if isinstance(attr, str): + if attr.lower() in ["true", "1"]: + return True + if attr.lower() in ["false", "0"]: + return False + raise TypeError("Invalid boolean value: {}".format(attr)) + + if data_type == "str": + return self.deserialize_unicode(attr) + return eval(data_type)(attr) # nosec # pylint: disable=eval-used + + @staticmethod + def deserialize_unicode(data): + """Preserve unicode objects in Python 2, otherwise return data + as a string. + + :param str data: response string to be deserialized. + :return: Deserialized string. + :rtype: str or unicode + """ + # We might be here because we have an enum modeled as string, + # and we try to deserialize a partial dict with enum inside + if isinstance(data, Enum): + return data + + # Consider this is real string + try: + if isinstance(data, unicode): # type: ignore + return data + except NameError: + return str(data) + return str(data) + + @staticmethod + def deserialize_enum(data, enum_obj): + """Deserialize string into enum object. + + If the string is not a valid enum value it will be returned as-is + and a warning will be logged. + + :param str data: Response string to be deserialized. If this value is + None or invalid it will be returned as-is. + :param Enum enum_obj: Enum object to deserialize to. + :return: Deserialized enum object. + :rtype: Enum + """ + if isinstance(data, enum_obj) or data is None: + return data + if isinstance(data, Enum): + data = data.value + if isinstance(data, int): + # Workaround. We might consider remove it in the future. + try: + return list(enum_obj.__members__.values())[data] + except IndexError as exc: + error = "{!r} is not a valid index for enum {!r}" + raise DeserializationError(error.format(data, enum_obj)) from exc + try: + return enum_obj(str(data)) + except ValueError: + for enum_value in enum_obj: + if enum_value.value.lower() == str(data).lower(): + return enum_value + # We don't fail anymore for unknown value, we deserialize as a string + _LOGGER.warning("Deserializer is not able to find %s as valid enum in %s", data, enum_obj) + return Deserializer.deserialize_unicode(data) + + @staticmethod + def deserialize_bytearray(attr): + """Deserialize string into bytearray. + + :param str attr: response string to be deserialized. + :return: Deserialized bytearray + :rtype: bytearray + :raises: TypeError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + return bytearray(b64decode(attr)) # type: ignore + + @staticmethod + def deserialize_base64(attr): + """Deserialize base64 encoded string into string. + + :param str attr: response string to be deserialized. + :return: Deserialized base64 string + :rtype: bytearray + :raises: TypeError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + padding = "=" * (3 - (len(attr) + 3) % 4) # type: ignore + attr = attr + padding # type: ignore + encoded = attr.replace("-", "+").replace("_", "/") + return b64decode(encoded) + + @staticmethod + def deserialize_decimal(attr): + """Deserialize string into Decimal object. + + :param str attr: response string to be deserialized. + :return: Deserialized decimal + :raises: DeserializationError if string format invalid. + :rtype: decimal + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + return decimal.Decimal(str(attr)) # type: ignore + except decimal.DecimalException as err: + msg = "Invalid decimal {}".format(attr) + raise DeserializationError(msg) from err + + @staticmethod + def deserialize_long(attr): + """Deserialize string into long (Py2) or int (Py3). + + :param str attr: response string to be deserialized. + :return: Deserialized int + :rtype: long or int + :raises: ValueError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + return _long_type(attr) # type: ignore + + @staticmethod + def deserialize_duration(attr): + """Deserialize ISO-8601 formatted string into TimeDelta object. + + :param str attr: response string to be deserialized. + :return: Deserialized duration + :rtype: TimeDelta + :raises: DeserializationError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + duration = isodate.parse_duration(attr) + except (ValueError, OverflowError, AttributeError) as err: + msg = "Cannot deserialize duration object." + raise DeserializationError(msg) from err + return duration + + @staticmethod + def deserialize_date(attr): + """Deserialize ISO-8601 formatted string into Date object. + + :param str attr: response string to be deserialized. + :return: Deserialized date + :rtype: Date + :raises: DeserializationError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + if re.search(r"[^\W\d_]", attr, re.I + re.U): # type: ignore + raise DeserializationError("Date must have only digits and -. Received: %s" % attr) + # This must NOT use defaultmonth/defaultday. Using None ensure this raises an exception. + return isodate.parse_date(attr, defaultmonth=0, defaultday=0) + + @staticmethod + def deserialize_time(attr): + """Deserialize ISO-8601 formatted string into time object. + + :param str attr: response string to be deserialized. + :return: Deserialized time + :rtype: datetime.time + :raises: DeserializationError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + if re.search(r"[^\W\d_]", attr, re.I + re.U): # type: ignore + raise DeserializationError("Date must have only digits and -. Received: %s" % attr) + return isodate.parse_time(attr) + + @staticmethod + def deserialize_rfc(attr): + """Deserialize RFC-1123 formatted string into Datetime object. + + :param str attr: response string to be deserialized. + :return: Deserialized RFC datetime + :rtype: Datetime + :raises: DeserializationError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + parsed_date = email.utils.parsedate_tz(attr) # type: ignore + date_obj = datetime.datetime( + *parsed_date[:6], tzinfo=_FixedOffset(datetime.timedelta(minutes=(parsed_date[9] or 0) / 60)) + ) + if not date_obj.tzinfo: + date_obj = date_obj.astimezone(tz=TZ_UTC) + except ValueError as err: + msg = "Cannot deserialize to rfc datetime object." + raise DeserializationError(msg) from err + return date_obj + + @staticmethod + def deserialize_iso(attr): + """Deserialize ISO-8601 formatted string into Datetime object. + + :param str attr: response string to be deserialized. + :return: Deserialized ISO datetime + :rtype: Datetime + :raises: DeserializationError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + attr = attr.upper() # type: ignore + match = Deserializer.valid_date.match(attr) + if not match: + raise ValueError("Invalid datetime string: " + attr) + + check_decimal = attr.split(".") + if len(check_decimal) > 1: + decimal_str = "" + for digit in check_decimal[1]: + if digit.isdigit(): + decimal_str += digit + else: + break + if len(decimal_str) > 6: + attr = attr.replace(decimal_str, decimal_str[0:6]) + + date_obj = isodate.parse_datetime(attr) + test_utc = date_obj.utctimetuple() + if test_utc.tm_year > 9999 or test_utc.tm_year < 1: + raise OverflowError("Hit max or min date") + except (ValueError, OverflowError, AttributeError) as err: + msg = "Cannot deserialize datetime object." + raise DeserializationError(msg) from err + return date_obj + + @staticmethod + def deserialize_unix(attr): + """Serialize Datetime object into IntTime format. + This is represented as seconds. + + :param int attr: Object to be serialized. + :return: Deserialized datetime + :rtype: Datetime + :raises: DeserializationError if format invalid + """ + if isinstance(attr, ET.Element): + attr = int(attr.text) # type: ignore + try: + attr = int(attr) + date_obj = datetime.datetime.fromtimestamp(attr, TZ_UTC) + except ValueError as err: + msg = "Cannot deserialize to unix datetime object." + raise DeserializationError(msg) from err + return date_obj diff --git a/packages/typespec-python/test/azure/generated/routes/routes/_vendor.py b/packages/typespec-python/test/azure/generated/routes/routes/_vendor.py new file mode 100644 index 00000000000..4c2c79a23d2 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/_vendor.py @@ -0,0 +1,26 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from abc import ABC +from typing import TYPE_CHECKING + +from ._configuration import RoutesClientConfiguration + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core import PipelineClient + + from ._serialization import Deserializer, Serializer + + +class RoutesClientMixinABC(ABC): + """DO NOT use this class. It is for internal typing use only.""" + + _client: "PipelineClient" + _config: RoutesClientConfiguration + _serialize: "Serializer" + _deserialize: "Deserializer" diff --git a/packages/typespec-python/test/azure/generated/routes/routes/_version.py b/packages/typespec-python/test/azure/generated/routes/routes/_version.py new file mode 100644 index 00000000000..be71c81bd28 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/_version.py @@ -0,0 +1,9 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +VERSION = "1.0.0b1" diff --git a/packages/typespec-python/test/azure/generated/routes/routes/aio/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/aio/__init__.py new file mode 100644 index 00000000000..626640c1366 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/aio/__init__.py @@ -0,0 +1,23 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._client import RoutesClient + +try: + from ._patch import __all__ as _patch_all + from ._patch import * # pylint: disable=unused-wildcard-import +except ImportError: + _patch_all = [] +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "RoutesClient", +] +__all__.extend([p for p in _patch_all if p not in __all__]) + +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/routes/routes/aio/_client.py b/packages/typespec-python/test/azure/generated/routes/routes/aio/_client.py new file mode 100644 index 00000000000..8af3b6a1eef --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/aio/_client.py @@ -0,0 +1,109 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from copy import deepcopy +from typing import Any, Awaitable +from typing_extensions import Self + +from azure.core import AsyncPipelineClient +from azure.core.pipeline import policies +from azure.core.rest import AsyncHttpResponse, HttpRequest + +from .._serialization import Deserializer, Serializer +from ._configuration import RoutesClientConfiguration +from .operations import ( + InInterfaceOperations, + PathParametersOperations, + QueryParametersOperations, + RoutesClientOperationsMixin, +) + + +class RoutesClient(RoutesClientOperationsMixin): # pylint: disable=client-accepts-api-version-keyword + """Define scenario in building the http route/uri. + + :ivar path_parameters: PathParametersOperations operations + :vartype path_parameters: routes.aio.operations.PathParametersOperations + :ivar query_parameters: QueryParametersOperations operations + :vartype query_parameters: routes.aio.operations.QueryParametersOperations + :ivar in_interface: InInterfaceOperations operations + :vartype in_interface: routes.aio.operations.InInterfaceOperations + :keyword endpoint: Service host. Default value is "http://localhost:3000". + :paramtype endpoint: str + """ + + def __init__( # pylint: disable=missing-client-constructor-parameter-credential + self, *, endpoint: str = "http://localhost:3000", **kwargs: Any + ) -> None: + _endpoint = "{endpoint}" + self._config = RoutesClientConfiguration(endpoint=endpoint, **kwargs) + _policies = kwargs.pop("policies", None) + if _policies is None: + _policies = [ + policies.RequestIdPolicy(**kwargs), + self._config.headers_policy, + self._config.user_agent_policy, + self._config.proxy_policy, + policies.ContentDecodePolicy(**kwargs), + self._config.redirect_policy, + self._config.retry_policy, + self._config.authentication_policy, + self._config.custom_hook_policy, + self._config.logging_policy, + policies.DistributedTracingPolicy(**kwargs), + policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, + self._config.http_logging_policy, + ] + self._client: AsyncPipelineClient = AsyncPipelineClient(base_url=_endpoint, policies=_policies, **kwargs) + + self._serialize = Serializer() + self._deserialize = Deserializer() + self._serialize.client_side_validation = False + self.path_parameters = PathParametersOperations(self._client, self._config, self._serialize, self._deserialize) + self.query_parameters = QueryParametersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.in_interface = InInterfaceOperations(self._client, self._config, self._serialize, self._deserialize) + + def send_request( + self, request: HttpRequest, *, stream: bool = False, **kwargs: Any + ) -> Awaitable[AsyncHttpResponse]: + """Runs the network request through the client's chained policies. + + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = await client.send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.rest.AsyncHttpResponse + """ + + request_copy = deepcopy(request) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + + request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) + return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore + + async def close(self) -> None: + await self._client.close() + + async def __aenter__(self) -> Self: + await self._client.__aenter__() + return self + + async def __aexit__(self, *exc_details: Any) -> None: + await self._client.__aexit__(*exc_details) diff --git a/packages/typespec-python/test/azure/generated/routes/routes/aio/_configuration.py b/packages/typespec-python/test/azure/generated/routes/routes/aio/_configuration.py new file mode 100644 index 00000000000..c9022e831e7 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/aio/_configuration.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any + +from azure.core.pipeline import policies + +from .._version import VERSION + + +class RoutesClientConfiguration: # pylint: disable=too-many-instance-attributes + """Configuration for RoutesClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param endpoint: Service host. Default value is "http://localhost:3000". + :type endpoint: str + """ + + def __init__(self, endpoint: str = "http://localhost:3000", **kwargs: Any) -> None: + + self.endpoint = endpoint + kwargs.setdefault("sdk_moniker", "routes/{}".format(VERSION)) + self.polling_interval = kwargs.get("polling_interval", 30) + self._configure(**kwargs) + + def _configure(self, **kwargs: Any) -> None: + self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) + self.http_logging_policy = kwargs.get("http_logging_policy") or policies.HttpLoggingPolicy(**kwargs) + self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs) + self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") diff --git a/packages/typespec-python/test/azure/generated/routes/routes/aio/_patch.py b/packages/typespec-python/test/azure/generated/routes/routes/aio/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/aio/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/routes/routes/aio/_vendor.py b/packages/typespec-python/test/azure/generated/routes/routes/aio/_vendor.py new file mode 100644 index 00000000000..726acb9af01 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/aio/_vendor.py @@ -0,0 +1,26 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from abc import ABC +from typing import TYPE_CHECKING + +from ._configuration import RoutesClientConfiguration + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core import AsyncPipelineClient + + from .._serialization import Deserializer, Serializer + + +class RoutesClientMixinABC(ABC): + """DO NOT use this class. It is for internal typing use only.""" + + _client: "AsyncPipelineClient" + _config: RoutesClientConfiguration + _serialize: "Serializer" + _deserialize: "Deserializer" diff --git a/packages/typespec-python/test/azure/generated/routes/routes/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/aio/operations/__init__.py new file mode 100644 index 00000000000..b7bb1b5599d --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/aio/operations/__init__.py @@ -0,0 +1,25 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._operations import PathParametersOperations +from ._operations import QueryParametersOperations +from ._operations import InInterfaceOperations +from ._operations import RoutesClientOperationsMixin + +from ._patch import __all__ as _patch_all +from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "PathParametersOperations", + "QueryParametersOperations", + "InInterfaceOperations", + "RoutesClientOperationsMixin", +] +__all__.extend([p for p in _patch_all if p not in __all__]) +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/routes/routes/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/routes/routes/aio/operations/_operations.py new file mode 100644 index 00000000000..46c288a5cee --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/aio/operations/_operations.py @@ -0,0 +1,2729 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, List, Optional, Type, TypeVar + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async + +from ...operations._operations import ( + build_in_interface_fixed_request, + build_path_parameters_annotation_only_request, + build_path_parameters_explicit_request, + build_path_parameters_label_expansion_explode_array_request, + build_path_parameters_label_expansion_explode_primitive_request, + build_path_parameters_label_expansion_explode_record_request, + build_path_parameters_label_expansion_standard_array_request, + build_path_parameters_label_expansion_standard_primitive_request, + build_path_parameters_label_expansion_standard_record_request, + build_path_parameters_matrix_expansion_explode_array_request, + build_path_parameters_matrix_expansion_explode_primitive_request, + build_path_parameters_matrix_expansion_explode_record_request, + build_path_parameters_matrix_expansion_standard_array_request, + build_path_parameters_matrix_expansion_standard_primitive_request, + build_path_parameters_matrix_expansion_standard_record_request, + build_path_parameters_path_expansion_explode_array_request, + build_path_parameters_path_expansion_explode_primitive_request, + build_path_parameters_path_expansion_explode_record_request, + build_path_parameters_path_expansion_standard_array_request, + build_path_parameters_path_expansion_standard_primitive_request, + build_path_parameters_path_expansion_standard_record_request, + build_path_parameters_reserved_expansion_annotation_request, + build_path_parameters_reserved_expansion_template_request, + build_path_parameters_simple_expansion_explode_array_request, + build_path_parameters_simple_expansion_explode_primitive_request, + build_path_parameters_simple_expansion_explode_record_request, + build_path_parameters_simple_expansion_standard_array_request, + build_path_parameters_simple_expansion_standard_primitive_request, + build_path_parameters_simple_expansion_standard_record_request, + build_path_parameters_template_only_request, + build_query_parameters_annotation_only_request, + build_query_parameters_explicit_request, + build_query_parameters_query_continuation_explode_array_request, + build_query_parameters_query_continuation_explode_primitive_request, + build_query_parameters_query_continuation_explode_record_request, + build_query_parameters_query_continuation_standard_array_request, + build_query_parameters_query_continuation_standard_primitive_request, + build_query_parameters_query_continuation_standard_record_request, + build_query_parameters_query_expansion_explode_array_request, + build_query_parameters_query_expansion_explode_primitive_request, + build_query_parameters_query_expansion_explode_record_request, + build_query_parameters_query_expansion_standard_array_request, + build_query_parameters_query_expansion_standard_primitive_request, + build_query_parameters_query_expansion_standard_record_request, + build_query_parameters_template_only_request, + build_routes_fixed_request, +) +from .._vendor import RoutesClientMixinABC + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class PathParametersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.aio.RoutesClient`'s + :attr:`path_parameters` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + self.reserved_expansion = PathParametersReservedExpansionOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.simple_expansion = PathParametersSimpleExpansionOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.path_expansion = PathParametersPathExpansionOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.label_expansion = PathParametersLabelExpansionOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.matrix_expansion = PathParametersMatrixExpansionOperations( + self._client, self._config, self._serialize, self._deserialize + ) + + @distributed_trace_async + async def template_only(self, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """template_only. + + :param param: Required. + :type param: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_template_only_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def explicit(self, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """explicit. + + :param param: Required. + :type param: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_explicit_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def annotation_only( # pylint: disable=inconsistent-return-statements + self, param: str, **kwargs: Any + ) -> None: + """annotation_only. + + :param param: Required. + :type param: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_annotation_only_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class QueryParametersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.aio.RoutesClient`'s + :attr:`query_parameters` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + self.query_expansion = QueryParametersQueryExpansionOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.query_continuation = QueryParametersQueryContinuationOperations( + self._client, self._config, self._serialize, self._deserialize + ) + + @distributed_trace_async + async def template_only( # pylint: disable=inconsistent-return-statements + self, *, param: str, **kwargs: Any + ) -> None: + """template_only. + + :keyword param: Required. + :paramtype param: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_template_only_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def explicit(self, *, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """explicit. + + :keyword param: Required. + :paramtype param: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_explicit_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def annotation_only( # pylint: disable=inconsistent-return-statements + self, *, param: str, **kwargs: Any + ) -> None: + """annotation_only. + + :keyword param: Required. + :paramtype param: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_annotation_only_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class InInterfaceOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.aio.RoutesClient`'s + :attr:`in_interface` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def fixed(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """fixed. + + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_in_interface_fixed_request( + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class RoutesClientOperationsMixin(RoutesClientMixinABC): + + @distributed_trace_async + async def fixed(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """fixed. + + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_routes_fixed_request( + 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 = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class PathParametersReservedExpansionOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.aio.RoutesClient`'s + :attr:`reserved_expansion` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def template(self, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """template. + + :param param: Required. + :type param: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_reserved_expansion_template_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def annotation(self, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """annotation. + + :param param: Required. + :type param: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_reserved_expansion_annotation_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class PathParametersSimpleExpansionOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.aio.RoutesClient`'s + :attr:`simple_expansion` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + self.standard = PathParametersSimpleExpansionStandardOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.explode = PathParametersSimpleExpansionExplodeOperations( + self._client, self._config, self._serialize, self._deserialize + ) + + +class PathParametersPathExpansionOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.aio.RoutesClient`'s + :attr:`path_expansion` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + self.standard = PathParametersPathExpansionStandardOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.explode = PathParametersPathExpansionExplodeOperations( + self._client, self._config, self._serialize, self._deserialize + ) + + +class PathParametersLabelExpansionOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.aio.RoutesClient`'s + :attr:`label_expansion` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + self.standard = PathParametersLabelExpansionStandardOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.explode = PathParametersLabelExpansionExplodeOperations( + self._client, self._config, self._serialize, self._deserialize + ) + + +class PathParametersMatrixExpansionOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.aio.RoutesClient`'s + :attr:`matrix_expansion` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + self.standard = PathParametersMatrixExpansionStandardOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.explode = PathParametersMatrixExpansionExplodeOperations( + self._client, self._config, self._serialize, self._deserialize + ) + + +class QueryParametersQueryExpansionOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.aio.RoutesClient`'s + :attr:`query_expansion` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + self.standard = QueryParametersQueryExpansionStandardOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.explode = QueryParametersQueryExpansionExplodeOperations( + self._client, self._config, self._serialize, self._deserialize + ) + + +class QueryParametersQueryContinuationOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.aio.RoutesClient`'s + :attr:`query_continuation` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + self.standard = QueryParametersQueryContinuationStandardOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.explode = QueryParametersQueryContinuationExplodeOperations( + self._client, self._config, self._serialize, self._deserialize + ) + + +class PathParametersSimpleExpansionStandardOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.aio.RoutesClient`'s + :attr:`standard` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def primitive(self, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """primitive. + + :param param: Required. + :type param: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_simple_expansion_standard_primitive_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def array(self, param: List[str], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """array. + + :param param: Required. + :type param: list[str] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_simple_expansion_standard_array_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def record( # pylint: disable=inconsistent-return-statements + self, param: Dict[str, int], **kwargs: Any + ) -> None: + """record. + + :param param: Required. + :type param: dict[str, int] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_simple_expansion_standard_record_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class PathParametersSimpleExpansionExplodeOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.aio.RoutesClient`'s + :attr:`explode` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def primitive(self, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """primitive. + + :param param: Required. + :type param: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_simple_expansion_explode_primitive_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def array(self, param: List[str], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """array. + + :param param: Required. + :type param: list[str] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_simple_expansion_explode_array_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def record( # pylint: disable=inconsistent-return-statements + self, param: Dict[str, int], **kwargs: Any + ) -> None: + """record. + + :param param: Required. + :type param: dict[str, int] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_simple_expansion_explode_record_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class PathParametersPathExpansionStandardOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.aio.RoutesClient`'s + :attr:`standard` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def primitive(self, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """primitive. + + :param param: Required. + :type param: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_path_expansion_standard_primitive_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def array(self, param: List[str], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """array. + + :param param: Required. + :type param: list[str] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_path_expansion_standard_array_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def record( # pylint: disable=inconsistent-return-statements + self, param: Dict[str, int], **kwargs: Any + ) -> None: + """record. + + :param param: Required. + :type param: dict[str, int] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_path_expansion_standard_record_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class PathParametersPathExpansionExplodeOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.aio.RoutesClient`'s + :attr:`explode` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def primitive(self, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """primitive. + + :param param: Required. + :type param: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_path_expansion_explode_primitive_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def array(self, param: List[str], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """array. + + :param param: Required. + :type param: list[str] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_path_expansion_explode_array_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def record( # pylint: disable=inconsistent-return-statements + self, param: Dict[str, int], **kwargs: Any + ) -> None: + """record. + + :param param: Required. + :type param: dict[str, int] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_path_expansion_explode_record_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class PathParametersLabelExpansionStandardOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.aio.RoutesClient`'s + :attr:`standard` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def primitive(self, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """primitive. + + :param param: Required. + :type param: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_label_expansion_standard_primitive_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def array(self, param: List[str], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """array. + + :param param: Required. + :type param: list[str] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_label_expansion_standard_array_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def record( # pylint: disable=inconsistent-return-statements + self, param: Dict[str, int], **kwargs: Any + ) -> None: + """record. + + :param param: Required. + :type param: dict[str, int] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_label_expansion_standard_record_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class PathParametersLabelExpansionExplodeOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.aio.RoutesClient`'s + :attr:`explode` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def primitive(self, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """primitive. + + :param param: Required. + :type param: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_label_expansion_explode_primitive_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def array(self, param: List[str], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """array. + + :param param: Required. + :type param: list[str] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_label_expansion_explode_array_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def record( # pylint: disable=inconsistent-return-statements + self, param: Dict[str, int], **kwargs: Any + ) -> None: + """record. + + :param param: Required. + :type param: dict[str, int] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_label_expansion_explode_record_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class PathParametersMatrixExpansionStandardOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.aio.RoutesClient`'s + :attr:`standard` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def primitive(self, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """primitive. + + :param param: Required. + :type param: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_matrix_expansion_standard_primitive_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def array(self, param: List[str], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """array. + + :param param: Required. + :type param: list[str] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_matrix_expansion_standard_array_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def record( # pylint: disable=inconsistent-return-statements + self, param: Dict[str, int], **kwargs: Any + ) -> None: + """record. + + :param param: Required. + :type param: dict[str, int] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_matrix_expansion_standard_record_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class PathParametersMatrixExpansionExplodeOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.aio.RoutesClient`'s + :attr:`explode` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def primitive(self, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """primitive. + + :param param: Required. + :type param: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_matrix_expansion_explode_primitive_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def array(self, param: List[str], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """array. + + :param param: Required. + :type param: list[str] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_matrix_expansion_explode_array_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def record( # pylint: disable=inconsistent-return-statements + self, param: Dict[str, int], **kwargs: Any + ) -> None: + """record. + + :param param: Required. + :type param: dict[str, int] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_matrix_expansion_explode_record_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class QueryParametersQueryExpansionStandardOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.aio.RoutesClient`'s + :attr:`standard` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def primitive(self, *, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """primitive. + + :keyword param: Required. + :paramtype param: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_query_expansion_standard_primitive_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def array(self, *, param: List[str], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """array. + + :keyword param: Required. + :paramtype param: list[str] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_query_expansion_standard_array_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def record( # pylint: disable=inconsistent-return-statements + self, *, param: Dict[str, int], **kwargs: Any + ) -> None: + """record. + + :keyword param: Required. + :paramtype param: dict[str, int] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_query_expansion_standard_record_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class QueryParametersQueryExpansionExplodeOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.aio.RoutesClient`'s + :attr:`explode` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def primitive(self, *, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """primitive. + + :keyword param: Required. + :paramtype param: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_query_expansion_explode_primitive_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def array(self, *, param: List[str], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """array. + + :keyword param: Required. + :paramtype param: list[str] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_query_expansion_explode_array_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def record( # pylint: disable=inconsistent-return-statements + self, *, param: Dict[str, int], **kwargs: Any + ) -> None: + """record. + + :keyword param: Required. + :paramtype param: dict[str, int] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_query_expansion_explode_record_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class QueryParametersQueryContinuationStandardOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.aio.RoutesClient`'s + :attr:`standard` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def primitive(self, *, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """primitive. + + :keyword param: Required. + :paramtype param: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_query_continuation_standard_primitive_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def array(self, *, param: List[str], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """array. + + :keyword param: Required. + :paramtype param: list[str] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_query_continuation_standard_array_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def record( # pylint: disable=inconsistent-return-statements + self, *, param: Dict[str, int], **kwargs: Any + ) -> None: + """record. + + :keyword param: Required. + :paramtype param: dict[str, int] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_query_continuation_standard_record_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class QueryParametersQueryContinuationExplodeOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.aio.RoutesClient`'s + :attr:`explode` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def primitive(self, *, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """primitive. + + :keyword param: Required. + :paramtype param: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_query_continuation_explode_primitive_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def array(self, *, param: List[str], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """array. + + :keyword param: Required. + :paramtype param: list[str] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_query_continuation_explode_array_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def record( # pylint: disable=inconsistent-return-statements + self, *, param: Dict[str, int], **kwargs: Any + ) -> None: + """record. + + :keyword param: Required. + :paramtype param: dict[str, int] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_query_continuation_explode_record_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/routes/routes/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/routes/routes/aio/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/aio/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/routes/routes/operations/__init__.py b/packages/typespec-python/test/azure/generated/routes/routes/operations/__init__.py new file mode 100644 index 00000000000..b7bb1b5599d --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/operations/__init__.py @@ -0,0 +1,25 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._operations import PathParametersOperations +from ._operations import QueryParametersOperations +from ._operations import InInterfaceOperations +from ._operations import RoutesClientOperationsMixin + +from ._patch import __all__ as _patch_all +from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "PathParametersOperations", + "QueryParametersOperations", + "InInterfaceOperations", + "RoutesClientOperationsMixin", +] +__all__.extend([p for p in _patch_all if p not in __all__]) +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/routes/routes/operations/_operations.py b/packages/typespec-python/test/azure/generated/routes/routes/operations/_operations.py new file mode 100644 index 00000000000..1dcce2f5e90 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/operations/_operations.py @@ -0,0 +1,3282 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, List, Optional, Type, TypeVar + +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from azure.core.pipeline import PipelineResponse +from azure.core.rest import HttpRequest, HttpResponse +from azure.core.tracing.decorator import distributed_trace +from azure.core.utils import case_insensitive_dict + +from .._serialization import Serializer +from .._vendor import RoutesClientMixinABC + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_path_parameters_template_only_request( # pylint: disable=name-too-long + param: str, **kwargs: Any +) -> HttpRequest: + # Construct URL + _url = "/routes/path/template-only/{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +def build_path_parameters_explicit_request(param: str, **kwargs: Any) -> HttpRequest: + # Construct URL + _url = "/routes/path/explicit/{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +def build_path_parameters_annotation_only_request( # pylint: disable=name-too-long + param: str, **kwargs: Any +) -> HttpRequest: + # Construct URL + _url = "/routes/path/annotation-only/{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +def build_query_parameters_template_only_request( # pylint: disable=name-too-long + *, param: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + # Construct URL + _url = "/routes/query/template-only" + + # Construct parameters + _params["param"] = _SERIALIZER.query("param", param, "str") + + return HttpRequest(method="GET", url=_url, params=_params, **kwargs) + + +def build_query_parameters_explicit_request(*, param: str, **kwargs: Any) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + # Construct URL + _url = "/routes/query/explicit" + + # Construct parameters + _params["param"] = _SERIALIZER.query("param", param, "str") + + return HttpRequest(method="GET", url=_url, params=_params, **kwargs) + + +def build_query_parameters_annotation_only_request( # pylint: disable=name-too-long + *, param: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + # Construct URL + _url = "/routes/query/annotation-only" + + # Construct parameters + _params["param"] = _SERIALIZER.query("param", param, "str") + + return HttpRequest(method="GET", url=_url, params=_params, **kwargs) + + +def build_in_interface_fixed_request(**kwargs: Any) -> HttpRequest: + # Construct URL + _url = "/routes/in-interface/fixed" + + return HttpRequest(method="GET", url=_url, **kwargs) + + +def build_routes_fixed_request(**kwargs: Any) -> HttpRequest: + # Construct URL + _url = "/routes/fixed" + + return HttpRequest(method="GET", url=_url, **kwargs) + + +def build_path_parameters_reserved_expansion_template_request( # pylint: disable=name-too-long + param: str, **kwargs: Any +) -> HttpRequest: + # Construct URL + _url = "/routes/path/reserved-expansion/template/{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "str", skip_quote=True), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +def build_path_parameters_reserved_expansion_annotation_request( # pylint: disable=name-too-long + param: str, **kwargs: Any +) -> HttpRequest: + # Construct URL + _url = "/routes/path/reserved-expansion/annotation/{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "str", skip_quote=True), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +def build_path_parameters_simple_expansion_standard_primitive_request( # pylint: disable=name-too-long + param: str, **kwargs: Any +) -> HttpRequest: + # Construct URL + _url = "/routes/path/simple/standard/primitive{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +def build_path_parameters_simple_expansion_standard_array_request( # pylint: disable=name-too-long + param: List[str], **kwargs: Any +) -> HttpRequest: + # Construct URL + _url = "/routes/path/simple/standard/array{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "[str]"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +def build_path_parameters_simple_expansion_standard_record_request( # pylint: disable=name-too-long + param: Dict[str, int], **kwargs: Any +) -> HttpRequest: + # Construct URL + _url = "/routes/path/simple/standard/record{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "{int}"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +def build_path_parameters_simple_expansion_explode_primitive_request( # pylint: disable=name-too-long + param: str, **kwargs: Any +) -> HttpRequest: + # Construct URL + _url = "/routes/path/simple/explode/primitive{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +def build_path_parameters_simple_expansion_explode_array_request( # pylint: disable=name-too-long + param: List[str], **kwargs: Any +) -> HttpRequest: + # Construct URL + _url = "/routes/path/simple/explode/array{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "[str]"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +def build_path_parameters_simple_expansion_explode_record_request( # pylint: disable=name-too-long + param: Dict[str, int], **kwargs: Any +) -> HttpRequest: + # Construct URL + _url = "/routes/path/simple/explode/record{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "{int}"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +def build_path_parameters_path_expansion_standard_primitive_request( # pylint: disable=name-too-long + param: str, **kwargs: Any +) -> HttpRequest: + # Construct URL + _url = "/routes/path/path/standard/primitive{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +def build_path_parameters_path_expansion_standard_array_request( # pylint: disable=name-too-long + param: List[str], **kwargs: Any +) -> HttpRequest: + # Construct URL + _url = "/routes/path/path/standard/array{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "[str]"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +def build_path_parameters_path_expansion_standard_record_request( # pylint: disable=name-too-long + param: Dict[str, int], **kwargs: Any +) -> HttpRequest: + # Construct URL + _url = "/routes/path/path/standard/record{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "{int}"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +def build_path_parameters_path_expansion_explode_primitive_request( # pylint: disable=name-too-long + param: str, **kwargs: Any +) -> HttpRequest: + # Construct URL + _url = "/routes/path/path/explode/primitive{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +def build_path_parameters_path_expansion_explode_array_request( # pylint: disable=name-too-long + param: List[str], **kwargs: Any +) -> HttpRequest: + # Construct URL + _url = "/routes/path/path/explode/array{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "[str]"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +def build_path_parameters_path_expansion_explode_record_request( # pylint: disable=name-too-long + param: Dict[str, int], **kwargs: Any +) -> HttpRequest: + # Construct URL + _url = "/routes/path/path/explode/record{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "{int}"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +def build_path_parameters_label_expansion_standard_primitive_request( # pylint: disable=name-too-long + param: str, **kwargs: Any +) -> HttpRequest: + # Construct URL + _url = "/routes/path/label/standard/primitive{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +def build_path_parameters_label_expansion_standard_array_request( # pylint: disable=name-too-long + param: List[str], **kwargs: Any +) -> HttpRequest: + # Construct URL + _url = "/routes/path/label/standard/array{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "[str]"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +def build_path_parameters_label_expansion_standard_record_request( # pylint: disable=name-too-long + param: Dict[str, int], **kwargs: Any +) -> HttpRequest: + # Construct URL + _url = "/routes/path/label/standard/record{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "{int}"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +def build_path_parameters_label_expansion_explode_primitive_request( # pylint: disable=name-too-long + param: str, **kwargs: Any +) -> HttpRequest: + # Construct URL + _url = "/routes/path/label/explode/primitive{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +def build_path_parameters_label_expansion_explode_array_request( # pylint: disable=name-too-long + param: List[str], **kwargs: Any +) -> HttpRequest: + # Construct URL + _url = "/routes/path/label/explode/array{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "[str]"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +def build_path_parameters_label_expansion_explode_record_request( # pylint: disable=name-too-long + param: Dict[str, int], **kwargs: Any +) -> HttpRequest: + # Construct URL + _url = "/routes/path/label/explode/record{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "{int}"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +def build_path_parameters_matrix_expansion_standard_primitive_request( # pylint: disable=name-too-long + param: str, **kwargs: Any +) -> HttpRequest: + # Construct URL + _url = "/routes/path/matrix/standard/primitive{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +def build_path_parameters_matrix_expansion_standard_array_request( # pylint: disable=name-too-long + param: List[str], **kwargs: Any +) -> HttpRequest: + # Construct URL + _url = "/routes/path/matrix/standard/array{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "[str]"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +def build_path_parameters_matrix_expansion_standard_record_request( # pylint: disable=name-too-long + param: Dict[str, int], **kwargs: Any +) -> HttpRequest: + # Construct URL + _url = "/routes/path/matrix/standard/record{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "{int}"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +def build_path_parameters_matrix_expansion_explode_primitive_request( # pylint: disable=name-too-long + param: str, **kwargs: Any +) -> HttpRequest: + # Construct URL + _url = "/routes/path/matrix/explode/primitive{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +def build_path_parameters_matrix_expansion_explode_array_request( # pylint: disable=name-too-long + param: List[str], **kwargs: Any +) -> HttpRequest: + # Construct URL + _url = "/routes/path/matrix/explode/array{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "[str]"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +def build_path_parameters_matrix_expansion_explode_record_request( # pylint: disable=name-too-long + param: Dict[str, int], **kwargs: Any +) -> HttpRequest: + # Construct URL + _url = "/routes/path/matrix/explode/record{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "{int}"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +def build_query_parameters_query_expansion_standard_primitive_request( # pylint: disable=name-too-long + *, param: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + # Construct URL + _url = "/routes/query/query-expansion/standard/primitive" + + # Construct parameters + _params["param"] = _SERIALIZER.query("param", param, "str") + + return HttpRequest(method="GET", url=_url, params=_params, **kwargs) + + +def build_query_parameters_query_expansion_standard_array_request( # pylint: disable=name-too-long + *, param: List[str], **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + # Construct URL + _url = "/routes/query/query-expansion/standard/array" + + # Construct parameters + _params["param"] = [_SERIALIZER.query("param", q, "str") if q is not None else "" for q in param] + + return HttpRequest(method="GET", url=_url, params=_params, **kwargs) + + +def build_query_parameters_query_expansion_standard_record_request( # pylint: disable=name-too-long + *, param: Dict[str, int], **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + # Construct URL + _url = "/routes/query/query-expansion/standard/record" + + # Construct parameters + _params["param"] = _SERIALIZER.query("param", param, "{int}") + + return HttpRequest(method="GET", url=_url, params=_params, **kwargs) + + +def build_query_parameters_query_expansion_explode_primitive_request( # pylint: disable=name-too-long + *, param: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + # Construct URL + _url = "/routes/query/query-expansion/explode/primitive" + + # Construct parameters + _params["param"] = _SERIALIZER.query("param", param, "str") + + return HttpRequest(method="GET", url=_url, params=_params, **kwargs) + + +def build_query_parameters_query_expansion_explode_array_request( # pylint: disable=name-too-long + *, param: List[str], **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + # Construct URL + _url = "/routes/query/query-expansion/explode/array" + + # Construct parameters + _params["param"] = [_SERIALIZER.query("param", q, "str") if q is not None else "" for q in param] + + return HttpRequest(method="GET", url=_url, params=_params, **kwargs) + + +def build_query_parameters_query_expansion_explode_record_request( # pylint: disable=name-too-long + *, param: Dict[str, int], **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + # Construct URL + _url = "/routes/query/query-expansion/explode/record" + + # Construct parameters + _params["param"] = _SERIALIZER.query("param", param, "{int}") + + return HttpRequest(method="GET", url=_url, params=_params, **kwargs) + + +def build_query_parameters_query_continuation_standard_primitive_request( # pylint: disable=name-too-long + *, param: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + # Construct URL + _url = "/routes/query/query-continuation/standard/primitive?fixed=true" + + # Construct parameters + _params["param"] = _SERIALIZER.query("param", param, "str") + + return HttpRequest(method="GET", url=_url, params=_params, **kwargs) + + +def build_query_parameters_query_continuation_standard_array_request( # pylint: disable=name-too-long + *, param: List[str], **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + # Construct URL + _url = "/routes/query/query-continuation/standard/array?fixed=true" + + # Construct parameters + _params["param"] = [_SERIALIZER.query("param", q, "str") if q is not None else "" for q in param] + + return HttpRequest(method="GET", url=_url, params=_params, **kwargs) + + +def build_query_parameters_query_continuation_standard_record_request( # pylint: disable=name-too-long + *, param: Dict[str, int], **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + # Construct URL + _url = "/routes/query/query-continuation/standard/record?fixed=true" + + # Construct parameters + _params["param"] = _SERIALIZER.query("param", param, "{int}") + + return HttpRequest(method="GET", url=_url, params=_params, **kwargs) + + +def build_query_parameters_query_continuation_explode_primitive_request( # pylint: disable=name-too-long + *, param: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + # Construct URL + _url = "/routes/query/query-continuation/explode/primitive?fixed=true" + + # Construct parameters + _params["param"] = _SERIALIZER.query("param", param, "str") + + return HttpRequest(method="GET", url=_url, params=_params, **kwargs) + + +def build_query_parameters_query_continuation_explode_array_request( # pylint: disable=name-too-long + *, param: List[str], **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + # Construct URL + _url = "/routes/query/query-continuation/explode/array?fixed=true" + + # Construct parameters + _params["param"] = [_SERIALIZER.query("param", q, "str") if q is not None else "" for q in param] + + return HttpRequest(method="GET", url=_url, params=_params, **kwargs) + + +def build_query_parameters_query_continuation_explode_record_request( # pylint: disable=name-too-long + *, param: Dict[str, int], **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + # Construct URL + _url = "/routes/query/query-continuation/explode/record?fixed=true" + + # Construct parameters + _params["param"] = _SERIALIZER.query("param", param, "{int}") + + return HttpRequest(method="GET", url=_url, params=_params, **kwargs) + + +class PathParametersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.RoutesClient`'s + :attr:`path_parameters` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + self.reserved_expansion = PathParametersReservedExpansionOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.simple_expansion = PathParametersSimpleExpansionOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.path_expansion = PathParametersPathExpansionOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.label_expansion = PathParametersLabelExpansionOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.matrix_expansion = PathParametersMatrixExpansionOperations( + self._client, self._config, self._serialize, self._deserialize + ) + + @distributed_trace + def template_only(self, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """template_only. + + :param param: Required. + :type param: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_template_only_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def explicit(self, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """explicit. + + :param param: Required. + :type param: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_explicit_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def annotation_only(self, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """annotation_only. + + :param param: Required. + :type param: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_annotation_only_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class QueryParametersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.RoutesClient`'s + :attr:`query_parameters` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + self.query_expansion = QueryParametersQueryExpansionOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.query_continuation = QueryParametersQueryContinuationOperations( + self._client, self._config, self._serialize, self._deserialize + ) + + @distributed_trace + def template_only(self, *, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """template_only. + + :keyword param: Required. + :paramtype param: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_template_only_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def explicit(self, *, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """explicit. + + :keyword param: Required. + :paramtype param: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_explicit_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def annotation_only(self, *, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """annotation_only. + + :keyword param: Required. + :paramtype param: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_annotation_only_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class InInterfaceOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.RoutesClient`'s + :attr:`in_interface` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def fixed(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """fixed. + + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_in_interface_fixed_request( + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class RoutesClientOperationsMixin(RoutesClientMixinABC): + + @distributed_trace + def fixed(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """fixed. + + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_routes_fixed_request( + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class PathParametersReservedExpansionOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.RoutesClient`'s + :attr:`reserved_expansion` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def template(self, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """template. + + :param param: Required. + :type param: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_reserved_expansion_template_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def annotation(self, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """annotation. + + :param param: Required. + :type param: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_reserved_expansion_annotation_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class PathParametersSimpleExpansionOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.RoutesClient`'s + :attr:`simple_expansion` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + self.standard = PathParametersSimpleExpansionStandardOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.explode = PathParametersSimpleExpansionExplodeOperations( + self._client, self._config, self._serialize, self._deserialize + ) + + +class PathParametersPathExpansionOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.RoutesClient`'s + :attr:`path_expansion` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + self.standard = PathParametersPathExpansionStandardOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.explode = PathParametersPathExpansionExplodeOperations( + self._client, self._config, self._serialize, self._deserialize + ) + + +class PathParametersLabelExpansionOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.RoutesClient`'s + :attr:`label_expansion` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + self.standard = PathParametersLabelExpansionStandardOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.explode = PathParametersLabelExpansionExplodeOperations( + self._client, self._config, self._serialize, self._deserialize + ) + + +class PathParametersMatrixExpansionOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.RoutesClient`'s + :attr:`matrix_expansion` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + self.standard = PathParametersMatrixExpansionStandardOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.explode = PathParametersMatrixExpansionExplodeOperations( + self._client, self._config, self._serialize, self._deserialize + ) + + +class QueryParametersQueryExpansionOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.RoutesClient`'s + :attr:`query_expansion` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + self.standard = QueryParametersQueryExpansionStandardOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.explode = QueryParametersQueryExpansionExplodeOperations( + self._client, self._config, self._serialize, self._deserialize + ) + + +class QueryParametersQueryContinuationOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.RoutesClient`'s + :attr:`query_continuation` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + self.standard = QueryParametersQueryContinuationStandardOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.explode = QueryParametersQueryContinuationExplodeOperations( + self._client, self._config, self._serialize, self._deserialize + ) + + +class PathParametersSimpleExpansionStandardOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.RoutesClient`'s + :attr:`standard` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def primitive(self, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """primitive. + + :param param: Required. + :type param: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_simple_expansion_standard_primitive_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def array(self, param: List[str], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """array. + + :param param: Required. + :type param: list[str] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_simple_expansion_standard_array_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def record(self, param: Dict[str, int], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """record. + + :param param: Required. + :type param: dict[str, int] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_simple_expansion_standard_record_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class PathParametersSimpleExpansionExplodeOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.RoutesClient`'s + :attr:`explode` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def primitive(self, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """primitive. + + :param param: Required. + :type param: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_simple_expansion_explode_primitive_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def array(self, param: List[str], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """array. + + :param param: Required. + :type param: list[str] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_simple_expansion_explode_array_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def record(self, param: Dict[str, int], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """record. + + :param param: Required. + :type param: dict[str, int] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_simple_expansion_explode_record_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class PathParametersPathExpansionStandardOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.RoutesClient`'s + :attr:`standard` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def primitive(self, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """primitive. + + :param param: Required. + :type param: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_path_expansion_standard_primitive_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def array(self, param: List[str], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """array. + + :param param: Required. + :type param: list[str] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_path_expansion_standard_array_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def record(self, param: Dict[str, int], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """record. + + :param param: Required. + :type param: dict[str, int] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_path_expansion_standard_record_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class PathParametersPathExpansionExplodeOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.RoutesClient`'s + :attr:`explode` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def primitive(self, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """primitive. + + :param param: Required. + :type param: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_path_expansion_explode_primitive_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def array(self, param: List[str], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """array. + + :param param: Required. + :type param: list[str] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_path_expansion_explode_array_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def record(self, param: Dict[str, int], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """record. + + :param param: Required. + :type param: dict[str, int] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_path_expansion_explode_record_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class PathParametersLabelExpansionStandardOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.RoutesClient`'s + :attr:`standard` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def primitive(self, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """primitive. + + :param param: Required. + :type param: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_label_expansion_standard_primitive_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def array(self, param: List[str], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """array. + + :param param: Required. + :type param: list[str] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_label_expansion_standard_array_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def record(self, param: Dict[str, int], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """record. + + :param param: Required. + :type param: dict[str, int] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_label_expansion_standard_record_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class PathParametersLabelExpansionExplodeOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.RoutesClient`'s + :attr:`explode` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def primitive(self, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """primitive. + + :param param: Required. + :type param: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_label_expansion_explode_primitive_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def array(self, param: List[str], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """array. + + :param param: Required. + :type param: list[str] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_label_expansion_explode_array_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def record(self, param: Dict[str, int], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """record. + + :param param: Required. + :type param: dict[str, int] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_label_expansion_explode_record_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class PathParametersMatrixExpansionStandardOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.RoutesClient`'s + :attr:`standard` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def primitive(self, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """primitive. + + :param param: Required. + :type param: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_matrix_expansion_standard_primitive_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def array(self, param: List[str], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """array. + + :param param: Required. + :type param: list[str] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_matrix_expansion_standard_array_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def record(self, param: Dict[str, int], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """record. + + :param param: Required. + :type param: dict[str, int] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_matrix_expansion_standard_record_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class PathParametersMatrixExpansionExplodeOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.RoutesClient`'s + :attr:`explode` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def primitive(self, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """primitive. + + :param param: Required. + :type param: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_matrix_expansion_explode_primitive_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def array(self, param: List[str], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """array. + + :param param: Required. + :type param: list[str] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_matrix_expansion_explode_array_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def record(self, param: Dict[str, int], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """record. + + :param param: Required. + :type param: dict[str, int] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_matrix_expansion_explode_record_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class QueryParametersQueryExpansionStandardOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.RoutesClient`'s + :attr:`standard` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def primitive(self, *, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """primitive. + + :keyword param: Required. + :paramtype param: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_query_expansion_standard_primitive_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def array(self, *, param: List[str], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """array. + + :keyword param: Required. + :paramtype param: list[str] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_query_expansion_standard_array_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def record(self, *, param: Dict[str, int], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """record. + + :keyword param: Required. + :paramtype param: dict[str, int] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_query_expansion_standard_record_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class QueryParametersQueryExpansionExplodeOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.RoutesClient`'s + :attr:`explode` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def primitive(self, *, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """primitive. + + :keyword param: Required. + :paramtype param: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_query_expansion_explode_primitive_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def array(self, *, param: List[str], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """array. + + :keyword param: Required. + :paramtype param: list[str] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_query_expansion_explode_array_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def record(self, *, param: Dict[str, int], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """record. + + :keyword param: Required. + :paramtype param: dict[str, int] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_query_expansion_explode_record_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class QueryParametersQueryContinuationStandardOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.RoutesClient`'s + :attr:`standard` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def primitive(self, *, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """primitive. + + :keyword param: Required. + :paramtype param: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_query_continuation_standard_primitive_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def array(self, *, param: List[str], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """array. + + :keyword param: Required. + :paramtype param: list[str] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_query_continuation_standard_array_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def record(self, *, param: Dict[str, int], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """record. + + :keyword param: Required. + :paramtype param: dict[str, int] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_query_continuation_standard_record_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class QueryParametersQueryContinuationExplodeOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.RoutesClient`'s + :attr:`explode` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def primitive(self, *, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """primitive. + + :keyword param: Required. + :paramtype param: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_query_continuation_explode_primitive_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def array(self, *, param: List[str], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """array. + + :keyword param: Required. + :paramtype param: list[str] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_query_continuation_explode_array_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def record(self, *, param: Dict[str, int], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """record. + + :keyword param: Required. + :paramtype param: dict[str, int] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_query_continuation_explode_record_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/routes/routes/operations/_patch.py b/packages/typespec-python/test/azure/generated/routes/routes/operations/_patch.py new file mode 100644 index 00000000000..f7dd3251033 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/azure/generated/routes/routes/py.typed b/packages/typespec-python/test/azure/generated/routes/routes/py.typed new file mode 100644 index 00000000000..e5aff4f83af --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/routes/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/packages/typespec-python/test/azure/generated/routes/setup.py b/packages/typespec-python/test/azure/generated/routes/setup.py new file mode 100644 index 00000000000..abbeba859d6 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/routes/setup.py @@ -0,0 +1,68 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# coding: utf-8 + +import os +import re +from setuptools import setup, find_packages + + +PACKAGE_NAME = "routes" +PACKAGE_PPRINT_NAME = "Routes" + +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") + +# Version extraction inspired from 'requests' +with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: + version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE).group(1) + +if not version: + raise RuntimeError("Cannot find version information") + + +setup( + name=PACKAGE_NAME, + version=version, + description="Microsoft {} Client Library for Python".format(PACKAGE_PPRINT_NAME), + long_description=open("README.md", "r").read(), + long_description_content_type="text/markdown", + license="MIT License", + author="Microsoft Corporation", + author_email="azpysdkhelp@microsoft.com", + url="https://github.com/Azure/azure-sdk-for-python/tree/main/sdk", + keywords="azure, azure sdk", + classifiers=[ + "Development Status :: 4 - Beta", + "Programming Language :: Python", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "License :: OSI Approved :: MIT License", + ], + zip_safe=False, + packages=find_packages( + exclude=[ + "tests", + ] + ), + include_package_data=True, + package_data={ + "routes": ["py.typed"], + }, + install_requires=[ + "isodate>=0.6.1", + "azure-core>=1.30.0", + "typing-extensions>=4.6.0", + ], + python_requires=">=3.8", +) diff --git a/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/generated_tests/test_json_property_operations.py b/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/generated_tests/test_json_property_operations.py index 7b24b7d72aa..ffa148b4644 100644 --- a/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/generated_tests/test_json_property_operations.py +++ b/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/generated_tests/test_json_property_operations.py @@ -14,7 +14,7 @@ class TestJsonPropertyOperations(JsonClientTestBase): @JsonPreparer() @recorded_by_proxy - def test_send(self, json_endpoint): + def test_property_send(self, json_endpoint): client = self.create_client(endpoint=json_endpoint) response = client.property.send( body={"wireName": bool}, @@ -25,7 +25,7 @@ def test_send(self, json_endpoint): @JsonPreparer() @recorded_by_proxy - def test_get(self, json_endpoint): + def test_property_get(self, json_endpoint): client = self.create_client(endpoint=json_endpoint) response = client.property.get() diff --git a/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/generated_tests/test_json_property_operations_async.py b/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/generated_tests/test_json_property_operations_async.py index c4301ca0de9..44de344c6f5 100644 --- a/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/generated_tests/test_json_property_operations_async.py +++ b/packages/typespec-python/test/azure/generated/serialization-encoded-name-json/generated_tests/test_json_property_operations_async.py @@ -15,7 +15,7 @@ class TestJsonPropertyOperationsAsync(JsonClientTestBaseAsync): @JsonPreparer() @recorded_by_proxy_async - async def test_send(self, json_endpoint): + async def test_property_send(self, json_endpoint): client = self.create_async_client(endpoint=json_endpoint) response = await client.property.send( body={"wireName": bool}, @@ -26,7 +26,7 @@ async def test_send(self, json_endpoint): @JsonPreparer() @recorded_by_proxy_async - async def test_get(self, json_endpoint): + async def test_property_get(self, json_endpoint): client = self.create_async_client(endpoint=json_endpoint) response = await client.property.get() diff --git a/packages/typespec-python/test/azure/generated/special-headers-conditional-request/apiview_mapping_python.json b/packages/typespec-python/test/azure/generated/special-headers-conditional-request/apiview_mapping_python.json index b3c393056f6..ffed3116d71 100644 --- a/packages/typespec-python/test/azure/generated/special-headers-conditional-request/apiview_mapping_python.json +++ b/packages/typespec-python/test/azure/generated/special-headers-conditional-request/apiview_mapping_python.json @@ -2,6 +2,8 @@ "CrossLanguagePackageId": "SpecialHeaders.ConditionalRequest", "CrossLanguageDefinitionId": { "specialheaders.conditionalrequest.ConditionalRequestClient.post_if_match": "SpecialHeaders.ConditionalRequest.postIfMatch", - "specialheaders.conditionalrequest.ConditionalRequestClient.post_if_none_match": "SpecialHeaders.ConditionalRequest.postIfNoneMatch" + "specialheaders.conditionalrequest.ConditionalRequestClient.post_if_none_match": "SpecialHeaders.ConditionalRequest.postIfNoneMatch", + "specialheaders.conditionalrequest.ConditionalRequestClient.head_if_modified_since": "SpecialHeaders.ConditionalRequest.headIfModifiedSince", + "specialheaders.conditionalrequest.ConditionalRequestClient.post_if_unmodified_since": "SpecialHeaders.ConditionalRequest.postIfUnmodifiedSince" } } \ No newline at end of file diff --git a/packages/typespec-python/test/azure/generated/special-headers-conditional-request/generated_tests/test_conditional_request.py b/packages/typespec-python/test/azure/generated/special-headers-conditional-request/generated_tests/test_conditional_request.py index 20b0a3a1276..3850898ec82 100644 --- a/packages/typespec-python/test/azure/generated/special-headers-conditional-request/generated_tests/test_conditional_request.py +++ b/packages/typespec-python/test/azure/generated/special-headers-conditional-request/generated_tests/test_conditional_request.py @@ -29,3 +29,21 @@ def test_post_if_none_match(self, conditionalrequest_endpoint): # please add some check logic here by yourself # ... + + @ConditionalRequestPreparer() + @recorded_by_proxy + def test_head_if_modified_since(self, conditionalrequest_endpoint): + client = self.create_client(endpoint=conditionalrequest_endpoint) + response = client.head_if_modified_since() + + # please add some check logic here by yourself + # ... + + @ConditionalRequestPreparer() + @recorded_by_proxy + def test_post_if_unmodified_since(self, conditionalrequest_endpoint): + client = self.create_client(endpoint=conditionalrequest_endpoint) + response = client.post_if_unmodified_since() + + # please add some check logic here by yourself + # ... diff --git a/packages/typespec-python/test/azure/generated/special-headers-conditional-request/generated_tests/test_conditional_request_async.py b/packages/typespec-python/test/azure/generated/special-headers-conditional-request/generated_tests/test_conditional_request_async.py index 978bcaf95c8..714becb95a0 100644 --- a/packages/typespec-python/test/azure/generated/special-headers-conditional-request/generated_tests/test_conditional_request_async.py +++ b/packages/typespec-python/test/azure/generated/special-headers-conditional-request/generated_tests/test_conditional_request_async.py @@ -30,3 +30,21 @@ async def test_post_if_none_match(self, conditionalrequest_endpoint): # please add some check logic here by yourself # ... + + @ConditionalRequestPreparer() + @recorded_by_proxy_async + async def test_head_if_modified_since(self, conditionalrequest_endpoint): + client = self.create_async_client(endpoint=conditionalrequest_endpoint) + response = await client.head_if_modified_since() + + # please add some check logic here by yourself + # ... + + @ConditionalRequestPreparer() + @recorded_by_proxy_async + async def test_post_if_unmodified_since(self, conditionalrequest_endpoint): + client = self.create_async_client(endpoint=conditionalrequest_endpoint) + response = await client.post_if_unmodified_since() + + # please add some check logic here by yourself + # ... diff --git a/packages/typespec-python/test/azure/generated/special-headers-conditional-request/specialheaders/conditionalrequest/_operations/_operations.py b/packages/typespec-python/test/azure/generated/special-headers-conditional-request/specialheaders/conditionalrequest/_operations/_operations.py index 1ebc8ae081b..3c9578ada09 100644 --- a/packages/typespec-python/test/azure/generated/special-headers-conditional-request/specialheaders/conditionalrequest/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/special-headers-conditional-request/specialheaders/conditionalrequest/_operations/_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import datetime import sys from typing import Any, Callable, Dict, Optional, Type, TypeVar @@ -76,6 +77,36 @@ def build_conditional_request_post_if_none_match_request( # pylint: disable=nam return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) +def build_conditional_request_head_if_modified_since_request( # pylint: disable=name-too-long + *, if_modified_since: Optional[datetime.datetime] = None, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + # Construct URL + _url = "/special-headers/conditional-request/if-modified-since" + + # Construct headers + if if_modified_since is not None: + _headers["If-Modified-Since"] = _SERIALIZER.header("if_modified_since", if_modified_since, "rfc-1123") + + return HttpRequest(method="HEAD", url=_url, headers=_headers, **kwargs) + + +def build_conditional_request_post_if_unmodified_since_request( # pylint: disable=name-too-long + *, if_unmodified_since: Optional[datetime.datetime] = None, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + # Construct URL + _url = "/special-headers/conditional-request/if-unmodified-since" + + # Construct headers + if if_unmodified_since is not None: + _headers["If-Unmodified-Since"] = _SERIALIZER.header("if_unmodified_since", if_unmodified_since, "rfc-1123") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + class ConditionalRequestClientOperationsMixin(ConditionalRequestClientMixinABC): @distributed_trace @@ -195,3 +226,106 @@ def post_if_none_match( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def head_if_modified_since(self, *, if_modified_since: Optional[datetime.datetime] = None, **kwargs: Any) -> bool: + """Check when only If-Modified-Since in header is defined. + + :keyword if_modified_since: A timestamp indicating the last modified time of the resource known + to the + client. The operation will be performed only if the resource on the service has + been modified since the specified time. Default value is None. + :paramtype if_modified_since: ~datetime.datetime + :return: bool + :rtype: bool + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_conditional_request_head_if_modified_since_request( + if_modified_since=if_modified_since, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + return 200 <= response.status_code <= 299 + + @distributed_trace + def post_if_unmodified_since( # pylint: disable=inconsistent-return-statements + self, *, if_unmodified_since: Optional[datetime.datetime] = None, **kwargs: Any + ) -> None: + """Check when only If-Unmodified-Since in header is defined. + + :keyword if_unmodified_since: A timestamp indicating the last modified time of the resource + known to the + client. The operation will be performed only if the resource on the service has + not been modified since the specified time. Default value is None. + :paramtype if_unmodified_since: ~datetime.datetime + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_conditional_request_post_if_unmodified_since_request( + if_unmodified_since=if_unmodified_since, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/special-headers-conditional-request/specialheaders/conditionalrequest/aio/_operations/_operations.py b/packages/typespec-python/test/azure/generated/special-headers-conditional-request/specialheaders/conditionalrequest/aio/_operations/_operations.py index 9aac55f6016..0451e8e2aae 100644 --- a/packages/typespec-python/test/azure/generated/special-headers-conditional-request/specialheaders/conditionalrequest/aio/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/special-headers-conditional-request/specialheaders/conditionalrequest/aio/_operations/_operations.py @@ -6,6 +6,7 @@ # Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import datetime import sys from typing import Any, Callable, Dict, Optional, Type, TypeVar @@ -24,8 +25,10 @@ from azure.core.tracing.decorator_async import distributed_trace_async from ..._operations._operations import ( + build_conditional_request_head_if_modified_since_request, build_conditional_request_post_if_match_request, build_conditional_request_post_if_none_match_request, + build_conditional_request_post_if_unmodified_since_request, ) from .._vendor import ConditionalRequestClientMixinABC @@ -156,3 +159,108 @@ async def post_if_none_match( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def head_if_modified_since( + self, *, if_modified_since: Optional[datetime.datetime] = None, **kwargs: Any + ) -> bool: + """Check when only If-Modified-Since in header is defined. + + :keyword if_modified_since: A timestamp indicating the last modified time of the resource known + to the + client. The operation will be performed only if the resource on the service has + been modified since the specified time. Default value is None. + :paramtype if_modified_since: ~datetime.datetime + :return: bool + :rtype: bool + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_conditional_request_head_if_modified_since_request( + if_modified_since=if_modified_since, + 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 = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + return 200 <= response.status_code <= 299 + + @distributed_trace_async + async def post_if_unmodified_since( # pylint: disable=inconsistent-return-statements + self, *, if_unmodified_since: Optional[datetime.datetime] = None, **kwargs: Any + ) -> None: + """Check when only If-Unmodified-Since in header is defined. + + :keyword if_unmodified_since: A timestamp indicating the last modified time of the resource + known to the + client. The operation will be performed only if the resource on the service has + not been modified since the specified time. Default value is None. + :paramtype if_unmodified_since: ~datetime.datetime + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_conditional_request_post_if_unmodified_since_request( + if_unmodified_since=if_unmodified_since, + 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 = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/special-words/generated_tests/test_special_words_model_properties_operations.py b/packages/typespec-python/test/azure/generated/special-words/generated_tests/test_special_words_model_properties_operations.py index 89029b37206..b0d93f73c52 100644 --- a/packages/typespec-python/test/azure/generated/special-words/generated_tests/test_special_words_model_properties_operations.py +++ b/packages/typespec-python/test/azure/generated/special-words/generated_tests/test_special_words_model_properties_operations.py @@ -14,7 +14,7 @@ class TestSpecialWordsModelPropertiesOperations(SpecialWordsClientTestBase): @SpecialWordsPreparer() @recorded_by_proxy - def test_same_as_model(self, specialwords_endpoint): + def test_model_properties_same_as_model(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.model_properties.same_as_model( body={"SameAsModel": "str"}, diff --git a/packages/typespec-python/test/azure/generated/special-words/generated_tests/test_special_words_model_properties_operations_async.py b/packages/typespec-python/test/azure/generated/special-words/generated_tests/test_special_words_model_properties_operations_async.py index 5947098e568..fe0b9e2887b 100644 --- a/packages/typespec-python/test/azure/generated/special-words/generated_tests/test_special_words_model_properties_operations_async.py +++ b/packages/typespec-python/test/azure/generated/special-words/generated_tests/test_special_words_model_properties_operations_async.py @@ -15,7 +15,7 @@ class TestSpecialWordsModelPropertiesOperationsAsync(SpecialWordsClientTestBaseAsync): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_same_as_model(self, specialwords_endpoint): + async def test_model_properties_same_as_model(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.model_properties.same_as_model( body={"SameAsModel": "str"}, diff --git a/packages/typespec-python/test/azure/generated/special-words/generated_tests/test_special_words_models_operations.py b/packages/typespec-python/test/azure/generated/special-words/generated_tests/test_special_words_models_operations.py index 68726bae4e3..1e4b1cce356 100644 --- a/packages/typespec-python/test/azure/generated/special-words/generated_tests/test_special_words_models_operations.py +++ b/packages/typespec-python/test/azure/generated/special-words/generated_tests/test_special_words_models_operations.py @@ -14,7 +14,7 @@ class TestSpecialWordsModelsOperations(SpecialWordsClientTestBase): @SpecialWordsPreparer() @recorded_by_proxy - def test_with_and(self, specialwords_endpoint): + def test_models_with_and(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.models.with_and( body={"name": "str"}, @@ -25,7 +25,7 @@ def test_with_and(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_with_as(self, specialwords_endpoint): + def test_models_with_as(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.models.with_as( body={"name": "str"}, @@ -36,7 +36,7 @@ def test_with_as(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_with_assert(self, specialwords_endpoint): + def test_models_with_assert(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.models.with_assert( body={"name": "str"}, @@ -47,7 +47,7 @@ def test_with_assert(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_with_async(self, specialwords_endpoint): + def test_models_with_async(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.models.with_async( body={"name": "str"}, @@ -58,7 +58,7 @@ def test_with_async(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_with_await(self, specialwords_endpoint): + def test_models_with_await(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.models.with_await( body={"name": "str"}, @@ -69,7 +69,7 @@ def test_with_await(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_with_break(self, specialwords_endpoint): + def test_models_with_break(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.models.with_break( body={"name": "str"}, @@ -80,7 +80,7 @@ def test_with_break(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_with_class(self, specialwords_endpoint): + def test_models_with_class(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.models.with_class( body={"name": "str"}, @@ -91,7 +91,7 @@ def test_with_class(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_with_constructor(self, specialwords_endpoint): + def test_models_with_constructor(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.models.with_constructor( body={"name": "str"}, @@ -102,7 +102,7 @@ def test_with_constructor(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_with_continue(self, specialwords_endpoint): + def test_models_with_continue(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.models.with_continue( body={"name": "str"}, @@ -113,7 +113,7 @@ def test_with_continue(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_with_def(self, specialwords_endpoint): + def test_models_with_def(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.models.with_def( body={"name": "str"}, @@ -124,7 +124,7 @@ def test_with_def(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_with_del(self, specialwords_endpoint): + def test_models_with_del(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.models.with_del( body={"name": "str"}, @@ -135,7 +135,7 @@ def test_with_del(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_with_elif(self, specialwords_endpoint): + def test_models_with_elif(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.models.with_elif( body={"name": "str"}, @@ -146,7 +146,7 @@ def test_with_elif(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_with_else(self, specialwords_endpoint): + def test_models_with_else(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.models.with_else( body={"name": "str"}, @@ -157,7 +157,7 @@ def test_with_else(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_with_except(self, specialwords_endpoint): + def test_models_with_except(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.models.with_except( body={"name": "str"}, @@ -168,7 +168,7 @@ def test_with_except(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_with_exec(self, specialwords_endpoint): + def test_models_with_exec(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.models.with_exec( body={"name": "str"}, @@ -179,7 +179,7 @@ def test_with_exec(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_with_finally(self, specialwords_endpoint): + def test_models_with_finally(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.models.with_finally( body={"name": "str"}, @@ -190,7 +190,7 @@ def test_with_finally(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_with_for(self, specialwords_endpoint): + def test_models_with_for(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.models.with_for( body={"name": "str"}, @@ -201,7 +201,7 @@ def test_with_for(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_with_from(self, specialwords_endpoint): + def test_models_with_from(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.models.with_from( body={"name": "str"}, @@ -212,7 +212,7 @@ def test_with_from(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_with_global(self, specialwords_endpoint): + def test_models_with_global(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.models.with_global( body={"name": "str"}, @@ -223,7 +223,7 @@ def test_with_global(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_with_if(self, specialwords_endpoint): + def test_models_with_if(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.models.with_if( body={"name": "str"}, @@ -234,7 +234,7 @@ def test_with_if(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_with_import(self, specialwords_endpoint): + def test_models_with_import(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.models.with_import( body={"name": "str"}, @@ -245,7 +245,7 @@ def test_with_import(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_with_in(self, specialwords_endpoint): + def test_models_with_in(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.models.with_in( body={"name": "str"}, @@ -256,7 +256,7 @@ def test_with_in(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_with_is(self, specialwords_endpoint): + def test_models_with_is(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.models.with_is( body={"name": "str"}, @@ -267,7 +267,7 @@ def test_with_is(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_with_lambda(self, specialwords_endpoint): + def test_models_with_lambda(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.models.with_lambda( body={"name": "str"}, @@ -278,7 +278,7 @@ def test_with_lambda(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_with_not(self, specialwords_endpoint): + def test_models_with_not(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.models.with_not( body={"name": "str"}, @@ -289,7 +289,7 @@ def test_with_not(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_with_or(self, specialwords_endpoint): + def test_models_with_or(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.models.with_or( body={"name": "str"}, @@ -300,7 +300,7 @@ def test_with_or(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_with_pass(self, specialwords_endpoint): + def test_models_with_pass(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.models.with_pass( body={"name": "str"}, @@ -311,7 +311,7 @@ def test_with_pass(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_with_raise(self, specialwords_endpoint): + def test_models_with_raise(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.models.with_raise( body={"name": "str"}, @@ -322,7 +322,7 @@ def test_with_raise(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_with_return(self, specialwords_endpoint): + def test_models_with_return(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.models.with_return( body={"name": "str"}, @@ -333,7 +333,7 @@ def test_with_return(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_with_try(self, specialwords_endpoint): + def test_models_with_try(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.models.with_try( body={"name": "str"}, @@ -344,7 +344,7 @@ def test_with_try(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_with_while(self, specialwords_endpoint): + def test_models_with_while(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.models.with_while( body={"name": "str"}, @@ -355,7 +355,7 @@ def test_with_while(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_with_with(self, specialwords_endpoint): + def test_models_with_with(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.models.with_with( body={"name": "str"}, @@ -366,7 +366,7 @@ def test_with_with(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_with_yield(self, specialwords_endpoint): + def test_models_with_yield(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.models.with_yield( body={"name": "str"}, diff --git a/packages/typespec-python/test/azure/generated/special-words/generated_tests/test_special_words_models_operations_async.py b/packages/typespec-python/test/azure/generated/special-words/generated_tests/test_special_words_models_operations_async.py index 940174fc486..36c089dc3a4 100644 --- a/packages/typespec-python/test/azure/generated/special-words/generated_tests/test_special_words_models_operations_async.py +++ b/packages/typespec-python/test/azure/generated/special-words/generated_tests/test_special_words_models_operations_async.py @@ -15,7 +15,7 @@ class TestSpecialWordsModelsOperationsAsync(SpecialWordsClientTestBaseAsync): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_with_and(self, specialwords_endpoint): + async def test_models_with_and(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.models.with_and( body={"name": "str"}, @@ -26,7 +26,7 @@ async def test_with_and(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_with_as(self, specialwords_endpoint): + async def test_models_with_as(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.models.with_as( body={"name": "str"}, @@ -37,7 +37,7 @@ async def test_with_as(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_with_assert(self, specialwords_endpoint): + async def test_models_with_assert(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.models.with_assert( body={"name": "str"}, @@ -48,7 +48,7 @@ async def test_with_assert(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_with_async(self, specialwords_endpoint): + async def test_models_with_async(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.models.with_async( body={"name": "str"}, @@ -59,7 +59,7 @@ async def test_with_async(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_with_await(self, specialwords_endpoint): + async def test_models_with_await(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.models.with_await( body={"name": "str"}, @@ -70,7 +70,7 @@ async def test_with_await(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_with_break(self, specialwords_endpoint): + async def test_models_with_break(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.models.with_break( body={"name": "str"}, @@ -81,7 +81,7 @@ async def test_with_break(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_with_class(self, specialwords_endpoint): + async def test_models_with_class(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.models.with_class( body={"name": "str"}, @@ -92,7 +92,7 @@ async def test_with_class(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_with_constructor(self, specialwords_endpoint): + async def test_models_with_constructor(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.models.with_constructor( body={"name": "str"}, @@ -103,7 +103,7 @@ async def test_with_constructor(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_with_continue(self, specialwords_endpoint): + async def test_models_with_continue(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.models.with_continue( body={"name": "str"}, @@ -114,7 +114,7 @@ async def test_with_continue(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_with_def(self, specialwords_endpoint): + async def test_models_with_def(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.models.with_def( body={"name": "str"}, @@ -125,7 +125,7 @@ async def test_with_def(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_with_del(self, specialwords_endpoint): + async def test_models_with_del(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.models.with_del( body={"name": "str"}, @@ -136,7 +136,7 @@ async def test_with_del(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_with_elif(self, specialwords_endpoint): + async def test_models_with_elif(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.models.with_elif( body={"name": "str"}, @@ -147,7 +147,7 @@ async def test_with_elif(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_with_else(self, specialwords_endpoint): + async def test_models_with_else(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.models.with_else( body={"name": "str"}, @@ -158,7 +158,7 @@ async def test_with_else(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_with_except(self, specialwords_endpoint): + async def test_models_with_except(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.models.with_except( body={"name": "str"}, @@ -169,7 +169,7 @@ async def test_with_except(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_with_exec(self, specialwords_endpoint): + async def test_models_with_exec(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.models.with_exec( body={"name": "str"}, @@ -180,7 +180,7 @@ async def test_with_exec(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_with_finally(self, specialwords_endpoint): + async def test_models_with_finally(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.models.with_finally( body={"name": "str"}, @@ -191,7 +191,7 @@ async def test_with_finally(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_with_for(self, specialwords_endpoint): + async def test_models_with_for(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.models.with_for( body={"name": "str"}, @@ -202,7 +202,7 @@ async def test_with_for(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_with_from(self, specialwords_endpoint): + async def test_models_with_from(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.models.with_from( body={"name": "str"}, @@ -213,7 +213,7 @@ async def test_with_from(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_with_global(self, specialwords_endpoint): + async def test_models_with_global(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.models.with_global( body={"name": "str"}, @@ -224,7 +224,7 @@ async def test_with_global(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_with_if(self, specialwords_endpoint): + async def test_models_with_if(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.models.with_if( body={"name": "str"}, @@ -235,7 +235,7 @@ async def test_with_if(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_with_import(self, specialwords_endpoint): + async def test_models_with_import(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.models.with_import( body={"name": "str"}, @@ -246,7 +246,7 @@ async def test_with_import(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_with_in(self, specialwords_endpoint): + async def test_models_with_in(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.models.with_in( body={"name": "str"}, @@ -257,7 +257,7 @@ async def test_with_in(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_with_is(self, specialwords_endpoint): + async def test_models_with_is(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.models.with_is( body={"name": "str"}, @@ -268,7 +268,7 @@ async def test_with_is(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_with_lambda(self, specialwords_endpoint): + async def test_models_with_lambda(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.models.with_lambda( body={"name": "str"}, @@ -279,7 +279,7 @@ async def test_with_lambda(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_with_not(self, specialwords_endpoint): + async def test_models_with_not(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.models.with_not( body={"name": "str"}, @@ -290,7 +290,7 @@ async def test_with_not(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_with_or(self, specialwords_endpoint): + async def test_models_with_or(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.models.with_or( body={"name": "str"}, @@ -301,7 +301,7 @@ async def test_with_or(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_with_pass(self, specialwords_endpoint): + async def test_models_with_pass(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.models.with_pass( body={"name": "str"}, @@ -312,7 +312,7 @@ async def test_with_pass(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_with_raise(self, specialwords_endpoint): + async def test_models_with_raise(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.models.with_raise( body={"name": "str"}, @@ -323,7 +323,7 @@ async def test_with_raise(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_with_return(self, specialwords_endpoint): + async def test_models_with_return(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.models.with_return( body={"name": "str"}, @@ -334,7 +334,7 @@ async def test_with_return(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_with_try(self, specialwords_endpoint): + async def test_models_with_try(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.models.with_try( body={"name": "str"}, @@ -345,7 +345,7 @@ async def test_with_try(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_with_while(self, specialwords_endpoint): + async def test_models_with_while(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.models.with_while( body={"name": "str"}, @@ -356,7 +356,7 @@ async def test_with_while(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_with_with(self, specialwords_endpoint): + async def test_models_with_with(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.models.with_with( body={"name": "str"}, @@ -367,7 +367,7 @@ async def test_with_with(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_with_yield(self, specialwords_endpoint): + async def test_models_with_yield(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.models.with_yield( body={"name": "str"}, diff --git a/packages/typespec-python/test/azure/generated/special-words/generated_tests/test_special_words_operations.py b/packages/typespec-python/test/azure/generated/special-words/generated_tests/test_special_words_operations.py index 8c72cdcbb74..e73807af358 100644 --- a/packages/typespec-python/test/azure/generated/special-words/generated_tests/test_special_words_operations.py +++ b/packages/typespec-python/test/azure/generated/special-words/generated_tests/test_special_words_operations.py @@ -14,7 +14,7 @@ class TestSpecialWordsOperations(SpecialWordsClientTestBase): @SpecialWordsPreparer() @recorded_by_proxy - def test_and_method(self, specialwords_endpoint): + def test_operations_and_method(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.operations.and_method() @@ -23,7 +23,7 @@ def test_and_method(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_as_method(self, specialwords_endpoint): + def test_operations_as_method(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.operations.as_method() @@ -32,7 +32,7 @@ def test_as_method(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_assert_method(self, specialwords_endpoint): + def test_operations_assert_method(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.operations.assert_method() @@ -41,7 +41,7 @@ def test_assert_method(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_async_method(self, specialwords_endpoint): + def test_operations_async_method(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.operations.async_method() @@ -50,7 +50,7 @@ def test_async_method(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_await_method(self, specialwords_endpoint): + def test_operations_await_method(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.operations.await_method() @@ -59,7 +59,7 @@ def test_await_method(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_break_method(self, specialwords_endpoint): + def test_operations_break_method(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.operations.break_method() @@ -68,7 +68,7 @@ def test_break_method(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_class_method(self, specialwords_endpoint): + def test_operations_class_method(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.operations.class_method() @@ -77,7 +77,7 @@ def test_class_method(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_constructor(self, specialwords_endpoint): + def test_operations_constructor(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.operations.constructor() @@ -86,7 +86,7 @@ def test_constructor(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_continue_method(self, specialwords_endpoint): + def test_operations_continue_method(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.operations.continue_method() @@ -95,7 +95,7 @@ def test_continue_method(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_def_method(self, specialwords_endpoint): + def test_operations_def_method(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.operations.def_method() @@ -104,7 +104,7 @@ def test_def_method(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_del_method(self, specialwords_endpoint): + def test_operations_del_method(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.operations.del_method() @@ -113,7 +113,7 @@ def test_del_method(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_elif_method(self, specialwords_endpoint): + def test_operations_elif_method(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.operations.elif_method() @@ -122,7 +122,7 @@ def test_elif_method(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_else_method(self, specialwords_endpoint): + def test_operations_else_method(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.operations.else_method() @@ -131,7 +131,7 @@ def test_else_method(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_except_method(self, specialwords_endpoint): + def test_operations_except_method(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.operations.except_method() @@ -140,7 +140,7 @@ def test_except_method(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_exec_method(self, specialwords_endpoint): + def test_operations_exec_method(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.operations.exec_method() @@ -149,7 +149,7 @@ def test_exec_method(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_finally_method(self, specialwords_endpoint): + def test_operations_finally_method(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.operations.finally_method() @@ -158,7 +158,7 @@ def test_finally_method(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_for_method(self, specialwords_endpoint): + def test_operations_for_method(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.operations.for_method() @@ -167,7 +167,7 @@ def test_for_method(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_from_method(self, specialwords_endpoint): + def test_operations_from_method(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.operations.from_method() @@ -176,7 +176,7 @@ def test_from_method(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_global_method(self, specialwords_endpoint): + def test_operations_global_method(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.operations.global_method() @@ -185,7 +185,7 @@ def test_global_method(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_if_method(self, specialwords_endpoint): + def test_operations_if_method(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.operations.if_method() @@ -194,7 +194,7 @@ def test_if_method(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_import_method(self, specialwords_endpoint): + def test_operations_import_method(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.operations.import_method() @@ -203,7 +203,7 @@ def test_import_method(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_in_method(self, specialwords_endpoint): + def test_operations_in_method(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.operations.in_method() @@ -212,7 +212,7 @@ def test_in_method(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_is_method(self, specialwords_endpoint): + def test_operations_is_method(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.operations.is_method() @@ -221,7 +221,7 @@ def test_is_method(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_lambda_method(self, specialwords_endpoint): + def test_operations_lambda_method(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.operations.lambda_method() @@ -230,7 +230,7 @@ def test_lambda_method(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_not_method(self, specialwords_endpoint): + def test_operations_not_method(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.operations.not_method() @@ -239,7 +239,7 @@ def test_not_method(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_or_method(self, specialwords_endpoint): + def test_operations_or_method(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.operations.or_method() @@ -248,7 +248,7 @@ def test_or_method(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_pass_method(self, specialwords_endpoint): + def test_operations_pass_method(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.operations.pass_method() @@ -257,7 +257,7 @@ def test_pass_method(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_raise_method(self, specialwords_endpoint): + def test_operations_raise_method(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.operations.raise_method() @@ -266,7 +266,7 @@ def test_raise_method(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_return_method(self, specialwords_endpoint): + def test_operations_return_method(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.operations.return_method() @@ -275,7 +275,7 @@ def test_return_method(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_try_method(self, specialwords_endpoint): + def test_operations_try_method(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.operations.try_method() @@ -284,7 +284,7 @@ def test_try_method(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_while_method(self, specialwords_endpoint): + def test_operations_while_method(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.operations.while_method() @@ -293,7 +293,7 @@ def test_while_method(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_with_method(self, specialwords_endpoint): + def test_operations_with_method(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.operations.with_method() @@ -302,7 +302,7 @@ def test_with_method(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_yield_method(self, specialwords_endpoint): + def test_operations_yield_method(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.operations.yield_method() diff --git a/packages/typespec-python/test/azure/generated/special-words/generated_tests/test_special_words_operations_async.py b/packages/typespec-python/test/azure/generated/special-words/generated_tests/test_special_words_operations_async.py index 477880c7f79..1404d0b1ef8 100644 --- a/packages/typespec-python/test/azure/generated/special-words/generated_tests/test_special_words_operations_async.py +++ b/packages/typespec-python/test/azure/generated/special-words/generated_tests/test_special_words_operations_async.py @@ -15,7 +15,7 @@ class TestSpecialWordsOperationsAsync(SpecialWordsClientTestBaseAsync): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_and_method(self, specialwords_endpoint): + async def test_operations_and_method(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.operations.and_method() @@ -24,7 +24,7 @@ async def test_and_method(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_as_method(self, specialwords_endpoint): + async def test_operations_as_method(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.operations.as_method() @@ -33,7 +33,7 @@ async def test_as_method(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_assert_method(self, specialwords_endpoint): + async def test_operations_assert_method(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.operations.assert_method() @@ -42,7 +42,7 @@ async def test_assert_method(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_async_method(self, specialwords_endpoint): + async def test_operations_async_method(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.operations.async_method() @@ -51,7 +51,7 @@ async def test_async_method(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_await_method(self, specialwords_endpoint): + async def test_operations_await_method(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.operations.await_method() @@ -60,7 +60,7 @@ async def test_await_method(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_break_method(self, specialwords_endpoint): + async def test_operations_break_method(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.operations.break_method() @@ -69,7 +69,7 @@ async def test_break_method(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_class_method(self, specialwords_endpoint): + async def test_operations_class_method(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.operations.class_method() @@ -78,7 +78,7 @@ async def test_class_method(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_constructor(self, specialwords_endpoint): + async def test_operations_constructor(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.operations.constructor() @@ -87,7 +87,7 @@ async def test_constructor(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_continue_method(self, specialwords_endpoint): + async def test_operations_continue_method(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.operations.continue_method() @@ -96,7 +96,7 @@ async def test_continue_method(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_def_method(self, specialwords_endpoint): + async def test_operations_def_method(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.operations.def_method() @@ -105,7 +105,7 @@ async def test_def_method(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_del_method(self, specialwords_endpoint): + async def test_operations_del_method(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.operations.del_method() @@ -114,7 +114,7 @@ async def test_del_method(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_elif_method(self, specialwords_endpoint): + async def test_operations_elif_method(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.operations.elif_method() @@ -123,7 +123,7 @@ async def test_elif_method(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_else_method(self, specialwords_endpoint): + async def test_operations_else_method(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.operations.else_method() @@ -132,7 +132,7 @@ async def test_else_method(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_except_method(self, specialwords_endpoint): + async def test_operations_except_method(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.operations.except_method() @@ -141,7 +141,7 @@ async def test_except_method(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_exec_method(self, specialwords_endpoint): + async def test_operations_exec_method(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.operations.exec_method() @@ -150,7 +150,7 @@ async def test_exec_method(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_finally_method(self, specialwords_endpoint): + async def test_operations_finally_method(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.operations.finally_method() @@ -159,7 +159,7 @@ async def test_finally_method(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_for_method(self, specialwords_endpoint): + async def test_operations_for_method(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.operations.for_method() @@ -168,7 +168,7 @@ async def test_for_method(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_from_method(self, specialwords_endpoint): + async def test_operations_from_method(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.operations.from_method() @@ -177,7 +177,7 @@ async def test_from_method(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_global_method(self, specialwords_endpoint): + async def test_operations_global_method(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.operations.global_method() @@ -186,7 +186,7 @@ async def test_global_method(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_if_method(self, specialwords_endpoint): + async def test_operations_if_method(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.operations.if_method() @@ -195,7 +195,7 @@ async def test_if_method(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_import_method(self, specialwords_endpoint): + async def test_operations_import_method(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.operations.import_method() @@ -204,7 +204,7 @@ async def test_import_method(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_in_method(self, specialwords_endpoint): + async def test_operations_in_method(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.operations.in_method() @@ -213,7 +213,7 @@ async def test_in_method(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_is_method(self, specialwords_endpoint): + async def test_operations_is_method(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.operations.is_method() @@ -222,7 +222,7 @@ async def test_is_method(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_lambda_method(self, specialwords_endpoint): + async def test_operations_lambda_method(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.operations.lambda_method() @@ -231,7 +231,7 @@ async def test_lambda_method(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_not_method(self, specialwords_endpoint): + async def test_operations_not_method(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.operations.not_method() @@ -240,7 +240,7 @@ async def test_not_method(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_or_method(self, specialwords_endpoint): + async def test_operations_or_method(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.operations.or_method() @@ -249,7 +249,7 @@ async def test_or_method(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_pass_method(self, specialwords_endpoint): + async def test_operations_pass_method(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.operations.pass_method() @@ -258,7 +258,7 @@ async def test_pass_method(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_raise_method(self, specialwords_endpoint): + async def test_operations_raise_method(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.operations.raise_method() @@ -267,7 +267,7 @@ async def test_raise_method(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_return_method(self, specialwords_endpoint): + async def test_operations_return_method(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.operations.return_method() @@ -276,7 +276,7 @@ async def test_return_method(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_try_method(self, specialwords_endpoint): + async def test_operations_try_method(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.operations.try_method() @@ -285,7 +285,7 @@ async def test_try_method(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_while_method(self, specialwords_endpoint): + async def test_operations_while_method(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.operations.while_method() @@ -294,7 +294,7 @@ async def test_while_method(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_with_method(self, specialwords_endpoint): + async def test_operations_with_method(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.operations.with_method() @@ -303,7 +303,7 @@ async def test_with_method(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_yield_method(self, specialwords_endpoint): + async def test_operations_yield_method(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.operations.yield_method() diff --git a/packages/typespec-python/test/azure/generated/special-words/generated_tests/test_special_words_parameters_operations.py b/packages/typespec-python/test/azure/generated/special-words/generated_tests/test_special_words_parameters_operations.py index fb891f6b4a5..3096a60a28e 100644 --- a/packages/typespec-python/test/azure/generated/special-words/generated_tests/test_special_words_parameters_operations.py +++ b/packages/typespec-python/test/azure/generated/special-words/generated_tests/test_special_words_parameters_operations.py @@ -14,7 +14,7 @@ class TestSpecialWordsParametersOperations(SpecialWordsClientTestBase): @SpecialWordsPreparer() @recorded_by_proxy - def test_with_and(self, specialwords_endpoint): + def test_parameters_with_and(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.parameters.with_and( and_parameter="str", @@ -25,7 +25,7 @@ def test_with_and(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_with_as(self, specialwords_endpoint): + def test_parameters_with_as(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.parameters.with_as( as_parameter="str", @@ -36,7 +36,7 @@ def test_with_as(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_with_assert(self, specialwords_endpoint): + def test_parameters_with_assert(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.parameters.with_assert( assert_parameter="str", @@ -47,7 +47,7 @@ def test_with_assert(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_with_async(self, specialwords_endpoint): + def test_parameters_with_async(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.parameters.with_async( async_parameter="str", @@ -58,7 +58,7 @@ def test_with_async(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_with_await(self, specialwords_endpoint): + def test_parameters_with_await(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.parameters.with_await( await_parameter="str", @@ -69,7 +69,7 @@ def test_with_await(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_with_break(self, specialwords_endpoint): + def test_parameters_with_break(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.parameters.with_break( break_parameter="str", @@ -80,7 +80,7 @@ def test_with_break(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_with_class(self, specialwords_endpoint): + def test_parameters_with_class(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.parameters.with_class( class_parameter="str", @@ -91,7 +91,7 @@ def test_with_class(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_with_constructor(self, specialwords_endpoint): + def test_parameters_with_constructor(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.parameters.with_constructor( constructor="str", @@ -102,7 +102,7 @@ def test_with_constructor(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_with_continue(self, specialwords_endpoint): + def test_parameters_with_continue(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.parameters.with_continue( continue_parameter="str", @@ -113,7 +113,7 @@ def test_with_continue(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_with_def(self, specialwords_endpoint): + def test_parameters_with_def(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.parameters.with_def( def_parameter="str", @@ -124,7 +124,7 @@ def test_with_def(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_with_del(self, specialwords_endpoint): + def test_parameters_with_del(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.parameters.with_del( del_parameter="str", @@ -135,7 +135,7 @@ def test_with_del(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_with_elif(self, specialwords_endpoint): + def test_parameters_with_elif(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.parameters.with_elif( elif_parameter="str", @@ -146,7 +146,7 @@ def test_with_elif(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_with_else(self, specialwords_endpoint): + def test_parameters_with_else(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.parameters.with_else( else_parameter="str", @@ -157,7 +157,7 @@ def test_with_else(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_with_except(self, specialwords_endpoint): + def test_parameters_with_except(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.parameters.with_except( except_parameter="str", @@ -168,7 +168,7 @@ def test_with_except(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_with_exec(self, specialwords_endpoint): + def test_parameters_with_exec(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.parameters.with_exec( exec_parameter="str", @@ -179,7 +179,7 @@ def test_with_exec(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_with_finally(self, specialwords_endpoint): + def test_parameters_with_finally(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.parameters.with_finally( finally_parameter="str", @@ -190,7 +190,7 @@ def test_with_finally(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_with_for(self, specialwords_endpoint): + def test_parameters_with_for(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.parameters.with_for( for_parameter="str", @@ -201,7 +201,7 @@ def test_with_for(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_with_from(self, specialwords_endpoint): + def test_parameters_with_from(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.parameters.with_from( from_parameter="str", @@ -212,7 +212,7 @@ def test_with_from(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_with_global(self, specialwords_endpoint): + def test_parameters_with_global(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.parameters.with_global( global_parameter="str", @@ -223,7 +223,7 @@ def test_with_global(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_with_if(self, specialwords_endpoint): + def test_parameters_with_if(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.parameters.with_if( if_parameter="str", @@ -234,7 +234,7 @@ def test_with_if(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_with_import(self, specialwords_endpoint): + def test_parameters_with_import(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.parameters.with_import( import_parameter="str", @@ -245,7 +245,7 @@ def test_with_import(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_with_in(self, specialwords_endpoint): + def test_parameters_with_in(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.parameters.with_in( in_parameter="str", @@ -256,7 +256,7 @@ def test_with_in(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_with_is(self, specialwords_endpoint): + def test_parameters_with_is(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.parameters.with_is( is_parameter="str", @@ -267,7 +267,7 @@ def test_with_is(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_with_lambda(self, specialwords_endpoint): + def test_parameters_with_lambda(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.parameters.with_lambda( lambda_parameter="str", @@ -278,7 +278,7 @@ def test_with_lambda(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_with_not(self, specialwords_endpoint): + def test_parameters_with_not(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.parameters.with_not( not_parameter="str", @@ -289,7 +289,7 @@ def test_with_not(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_with_or(self, specialwords_endpoint): + def test_parameters_with_or(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.parameters.with_or( or_parameter="str", @@ -300,7 +300,7 @@ def test_with_or(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_with_pass(self, specialwords_endpoint): + def test_parameters_with_pass(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.parameters.with_pass( pass_parameter="str", @@ -311,7 +311,7 @@ def test_with_pass(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_with_raise(self, specialwords_endpoint): + def test_parameters_with_raise(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.parameters.with_raise( raise_parameter="str", @@ -322,7 +322,7 @@ def test_with_raise(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_with_return(self, specialwords_endpoint): + def test_parameters_with_return(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.parameters.with_return( return_parameter="str", @@ -333,7 +333,7 @@ def test_with_return(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_with_try(self, specialwords_endpoint): + def test_parameters_with_try(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.parameters.with_try( try_parameter="str", @@ -344,7 +344,7 @@ def test_with_try(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_with_while(self, specialwords_endpoint): + def test_parameters_with_while(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.parameters.with_while( while_parameter="str", @@ -355,7 +355,7 @@ def test_with_while(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_with_with(self, specialwords_endpoint): + def test_parameters_with_with(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.parameters.with_with( with_parameter="str", @@ -366,7 +366,7 @@ def test_with_with(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_with_yield(self, specialwords_endpoint): + def test_parameters_with_yield(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.parameters.with_yield( yield_parameter="str", @@ -377,7 +377,7 @@ def test_with_yield(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy - def test_with_cancellation_token(self, specialwords_endpoint): + def test_parameters_with_cancellation_token(self, specialwords_endpoint): client = self.create_client(endpoint=specialwords_endpoint) response = client.parameters.with_cancellation_token( cancellation_token="str", diff --git a/packages/typespec-python/test/azure/generated/special-words/generated_tests/test_special_words_parameters_operations_async.py b/packages/typespec-python/test/azure/generated/special-words/generated_tests/test_special_words_parameters_operations_async.py index 2ccd65a13ed..94ca98849b1 100644 --- a/packages/typespec-python/test/azure/generated/special-words/generated_tests/test_special_words_parameters_operations_async.py +++ b/packages/typespec-python/test/azure/generated/special-words/generated_tests/test_special_words_parameters_operations_async.py @@ -15,7 +15,7 @@ class TestSpecialWordsParametersOperationsAsync(SpecialWordsClientTestBaseAsync): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_with_and(self, specialwords_endpoint): + async def test_parameters_with_and(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.parameters.with_and( and_parameter="str", @@ -26,7 +26,7 @@ async def test_with_and(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_with_as(self, specialwords_endpoint): + async def test_parameters_with_as(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.parameters.with_as( as_parameter="str", @@ -37,7 +37,7 @@ async def test_with_as(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_with_assert(self, specialwords_endpoint): + async def test_parameters_with_assert(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.parameters.with_assert( assert_parameter="str", @@ -48,7 +48,7 @@ async def test_with_assert(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_with_async(self, specialwords_endpoint): + async def test_parameters_with_async(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.parameters.with_async( async_parameter="str", @@ -59,7 +59,7 @@ async def test_with_async(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_with_await(self, specialwords_endpoint): + async def test_parameters_with_await(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.parameters.with_await( await_parameter="str", @@ -70,7 +70,7 @@ async def test_with_await(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_with_break(self, specialwords_endpoint): + async def test_parameters_with_break(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.parameters.with_break( break_parameter="str", @@ -81,7 +81,7 @@ async def test_with_break(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_with_class(self, specialwords_endpoint): + async def test_parameters_with_class(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.parameters.with_class( class_parameter="str", @@ -92,7 +92,7 @@ async def test_with_class(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_with_constructor(self, specialwords_endpoint): + async def test_parameters_with_constructor(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.parameters.with_constructor( constructor="str", @@ -103,7 +103,7 @@ async def test_with_constructor(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_with_continue(self, specialwords_endpoint): + async def test_parameters_with_continue(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.parameters.with_continue( continue_parameter="str", @@ -114,7 +114,7 @@ async def test_with_continue(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_with_def(self, specialwords_endpoint): + async def test_parameters_with_def(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.parameters.with_def( def_parameter="str", @@ -125,7 +125,7 @@ async def test_with_def(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_with_del(self, specialwords_endpoint): + async def test_parameters_with_del(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.parameters.with_del( del_parameter="str", @@ -136,7 +136,7 @@ async def test_with_del(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_with_elif(self, specialwords_endpoint): + async def test_parameters_with_elif(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.parameters.with_elif( elif_parameter="str", @@ -147,7 +147,7 @@ async def test_with_elif(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_with_else(self, specialwords_endpoint): + async def test_parameters_with_else(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.parameters.with_else( else_parameter="str", @@ -158,7 +158,7 @@ async def test_with_else(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_with_except(self, specialwords_endpoint): + async def test_parameters_with_except(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.parameters.with_except( except_parameter="str", @@ -169,7 +169,7 @@ async def test_with_except(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_with_exec(self, specialwords_endpoint): + async def test_parameters_with_exec(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.parameters.with_exec( exec_parameter="str", @@ -180,7 +180,7 @@ async def test_with_exec(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_with_finally(self, specialwords_endpoint): + async def test_parameters_with_finally(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.parameters.with_finally( finally_parameter="str", @@ -191,7 +191,7 @@ async def test_with_finally(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_with_for(self, specialwords_endpoint): + async def test_parameters_with_for(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.parameters.with_for( for_parameter="str", @@ -202,7 +202,7 @@ async def test_with_for(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_with_from(self, specialwords_endpoint): + async def test_parameters_with_from(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.parameters.with_from( from_parameter="str", @@ -213,7 +213,7 @@ async def test_with_from(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_with_global(self, specialwords_endpoint): + async def test_parameters_with_global(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.parameters.with_global( global_parameter="str", @@ -224,7 +224,7 @@ async def test_with_global(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_with_if(self, specialwords_endpoint): + async def test_parameters_with_if(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.parameters.with_if( if_parameter="str", @@ -235,7 +235,7 @@ async def test_with_if(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_with_import(self, specialwords_endpoint): + async def test_parameters_with_import(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.parameters.with_import( import_parameter="str", @@ -246,7 +246,7 @@ async def test_with_import(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_with_in(self, specialwords_endpoint): + async def test_parameters_with_in(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.parameters.with_in( in_parameter="str", @@ -257,7 +257,7 @@ async def test_with_in(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_with_is(self, specialwords_endpoint): + async def test_parameters_with_is(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.parameters.with_is( is_parameter="str", @@ -268,7 +268,7 @@ async def test_with_is(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_with_lambda(self, specialwords_endpoint): + async def test_parameters_with_lambda(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.parameters.with_lambda( lambda_parameter="str", @@ -279,7 +279,7 @@ async def test_with_lambda(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_with_not(self, specialwords_endpoint): + async def test_parameters_with_not(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.parameters.with_not( not_parameter="str", @@ -290,7 +290,7 @@ async def test_with_not(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_with_or(self, specialwords_endpoint): + async def test_parameters_with_or(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.parameters.with_or( or_parameter="str", @@ -301,7 +301,7 @@ async def test_with_or(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_with_pass(self, specialwords_endpoint): + async def test_parameters_with_pass(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.parameters.with_pass( pass_parameter="str", @@ -312,7 +312,7 @@ async def test_with_pass(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_with_raise(self, specialwords_endpoint): + async def test_parameters_with_raise(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.parameters.with_raise( raise_parameter="str", @@ -323,7 +323,7 @@ async def test_with_raise(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_with_return(self, specialwords_endpoint): + async def test_parameters_with_return(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.parameters.with_return( return_parameter="str", @@ -334,7 +334,7 @@ async def test_with_return(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_with_try(self, specialwords_endpoint): + async def test_parameters_with_try(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.parameters.with_try( try_parameter="str", @@ -345,7 +345,7 @@ async def test_with_try(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_with_while(self, specialwords_endpoint): + async def test_parameters_with_while(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.parameters.with_while( while_parameter="str", @@ -356,7 +356,7 @@ async def test_with_while(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_with_with(self, specialwords_endpoint): + async def test_parameters_with_with(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.parameters.with_with( with_parameter="str", @@ -367,7 +367,7 @@ async def test_with_with(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_with_yield(self, specialwords_endpoint): + async def test_parameters_with_yield(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.parameters.with_yield( yield_parameter="str", @@ -378,7 +378,7 @@ async def test_with_yield(self, specialwords_endpoint): @SpecialWordsPreparer() @recorded_by_proxy_async - async def test_with_cancellation_token(self, specialwords_endpoint): + async def test_parameters_with_cancellation_token(self, specialwords_endpoint): client = self.create_async_client(endpoint=specialwords_endpoint) response = await client.parameters.with_cancellation_token( cancellation_token="str", diff --git a/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_boolean_value_operations.py b/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_boolean_value_operations.py index 47f55cca290..a92d8a1de47 100644 --- a/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_boolean_value_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_boolean_value_operations.py @@ -14,7 +14,7 @@ class TestArrayBooleanValueOperations(ArrayClientTestBase): @ArrayPreparer() @recorded_by_proxy - def test_get(self, array_endpoint): + def test_boolean_value_get(self, array_endpoint): client = self.create_client(endpoint=array_endpoint) response = client.boolean_value.get() @@ -23,7 +23,7 @@ def test_get(self, array_endpoint): @ArrayPreparer() @recorded_by_proxy - def test_put(self, array_endpoint): + def test_boolean_value_put(self, array_endpoint): client = self.create_client(endpoint=array_endpoint) response = client.boolean_value.put( body=[bool], diff --git a/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_boolean_value_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_boolean_value_operations_async.py index a5508de219d..dbb00a2f7d6 100644 --- a/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_boolean_value_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_boolean_value_operations_async.py @@ -15,7 +15,7 @@ class TestArrayBooleanValueOperationsAsync(ArrayClientTestBaseAsync): @ArrayPreparer() @recorded_by_proxy_async - async def test_get(self, array_endpoint): + async def test_boolean_value_get(self, array_endpoint): client = self.create_async_client(endpoint=array_endpoint) response = await client.boolean_value.get() @@ -24,7 +24,7 @@ async def test_get(self, array_endpoint): @ArrayPreparer() @recorded_by_proxy_async - async def test_put(self, array_endpoint): + async def test_boolean_value_put(self, array_endpoint): client = self.create_async_client(endpoint=array_endpoint) response = await client.boolean_value.put( body=[bool], diff --git a/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_datetime_value_operations.py b/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_datetime_value_operations.py index 22a6a2cdd56..51c85df3067 100644 --- a/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_datetime_value_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_datetime_value_operations.py @@ -14,7 +14,7 @@ class TestArrayDatetimeValueOperations(ArrayClientTestBase): @ArrayPreparer() @recorded_by_proxy - def test_get(self, array_endpoint): + def test_datetime_value_get(self, array_endpoint): client = self.create_client(endpoint=array_endpoint) response = client.datetime_value.get() @@ -23,7 +23,7 @@ def test_get(self, array_endpoint): @ArrayPreparer() @recorded_by_proxy - def test_put(self, array_endpoint): + def test_datetime_value_put(self, array_endpoint): client = self.create_client(endpoint=array_endpoint) response = client.datetime_value.put( body=["2020-02-20 00:00:00"], diff --git a/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_datetime_value_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_datetime_value_operations_async.py index 2ae5c2780b8..c5143d890c3 100644 --- a/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_datetime_value_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_datetime_value_operations_async.py @@ -15,7 +15,7 @@ class TestArrayDatetimeValueOperationsAsync(ArrayClientTestBaseAsync): @ArrayPreparer() @recorded_by_proxy_async - async def test_get(self, array_endpoint): + async def test_datetime_value_get(self, array_endpoint): client = self.create_async_client(endpoint=array_endpoint) response = await client.datetime_value.get() @@ -24,7 +24,7 @@ async def test_get(self, array_endpoint): @ArrayPreparer() @recorded_by_proxy_async - async def test_put(self, array_endpoint): + async def test_datetime_value_put(self, array_endpoint): client = self.create_async_client(endpoint=array_endpoint) response = await client.datetime_value.put( body=["2020-02-20 00:00:00"], diff --git a/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_duration_value_operations.py b/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_duration_value_operations.py index b3be14c887c..e5f5d6f5398 100644 --- a/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_duration_value_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_duration_value_operations.py @@ -14,7 +14,7 @@ class TestArrayDurationValueOperations(ArrayClientTestBase): @ArrayPreparer() @recorded_by_proxy - def test_get(self, array_endpoint): + def test_duration_value_get(self, array_endpoint): client = self.create_client(endpoint=array_endpoint) response = client.duration_value.get() @@ -23,7 +23,7 @@ def test_get(self, array_endpoint): @ArrayPreparer() @recorded_by_proxy - def test_put(self, array_endpoint): + def test_duration_value_put(self, array_endpoint): client = self.create_client(endpoint=array_endpoint) response = client.duration_value.put( body=["1 day, 0:00:00"], diff --git a/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_duration_value_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_duration_value_operations_async.py index 14127c1acc1..d6dca6b97bb 100644 --- a/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_duration_value_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_duration_value_operations_async.py @@ -15,7 +15,7 @@ class TestArrayDurationValueOperationsAsync(ArrayClientTestBaseAsync): @ArrayPreparer() @recorded_by_proxy_async - async def test_get(self, array_endpoint): + async def test_duration_value_get(self, array_endpoint): client = self.create_async_client(endpoint=array_endpoint) response = await client.duration_value.get() @@ -24,7 +24,7 @@ async def test_get(self, array_endpoint): @ArrayPreparer() @recorded_by_proxy_async - async def test_put(self, array_endpoint): + async def test_duration_value_put(self, array_endpoint): client = self.create_async_client(endpoint=array_endpoint) response = await client.duration_value.put( body=["1 day, 0:00:00"], diff --git a/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_float32_value_operations.py b/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_float32_value_operations.py index c89e5b1c491..7667d59ab18 100644 --- a/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_float32_value_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_float32_value_operations.py @@ -14,7 +14,7 @@ class TestArrayFloat32ValueOperations(ArrayClientTestBase): @ArrayPreparer() @recorded_by_proxy - def test_get(self, array_endpoint): + def test_float32_value_get(self, array_endpoint): client = self.create_client(endpoint=array_endpoint) response = client.float32_value.get() @@ -23,7 +23,7 @@ def test_get(self, array_endpoint): @ArrayPreparer() @recorded_by_proxy - def test_put(self, array_endpoint): + def test_float32_value_put(self, array_endpoint): client = self.create_client(endpoint=array_endpoint) response = client.float32_value.put( body=[0.0], diff --git a/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_float32_value_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_float32_value_operations_async.py index 02bfeba675d..32d2941545f 100644 --- a/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_float32_value_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_float32_value_operations_async.py @@ -15,7 +15,7 @@ class TestArrayFloat32ValueOperationsAsync(ArrayClientTestBaseAsync): @ArrayPreparer() @recorded_by_proxy_async - async def test_get(self, array_endpoint): + async def test_float32_value_get(self, array_endpoint): client = self.create_async_client(endpoint=array_endpoint) response = await client.float32_value.get() @@ -24,7 +24,7 @@ async def test_get(self, array_endpoint): @ArrayPreparer() @recorded_by_proxy_async - async def test_put(self, array_endpoint): + async def test_float32_value_put(self, array_endpoint): client = self.create_async_client(endpoint=array_endpoint) response = await client.float32_value.put( body=[0.0], diff --git a/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_int32_value_operations.py b/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_int32_value_operations.py index 13f5eb82757..5d3d8e7b084 100644 --- a/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_int32_value_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_int32_value_operations.py @@ -14,7 +14,7 @@ class TestArrayInt32ValueOperations(ArrayClientTestBase): @ArrayPreparer() @recorded_by_proxy - def test_get(self, array_endpoint): + def test_int32_value_get(self, array_endpoint): client = self.create_client(endpoint=array_endpoint) response = client.int32_value.get() @@ -23,7 +23,7 @@ def test_get(self, array_endpoint): @ArrayPreparer() @recorded_by_proxy - def test_put(self, array_endpoint): + def test_int32_value_put(self, array_endpoint): client = self.create_client(endpoint=array_endpoint) response = client.int32_value.put( body=[0], diff --git a/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_int32_value_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_int32_value_operations_async.py index 762af31c0c3..945de66811c 100644 --- a/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_int32_value_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_int32_value_operations_async.py @@ -15,7 +15,7 @@ class TestArrayInt32ValueOperationsAsync(ArrayClientTestBaseAsync): @ArrayPreparer() @recorded_by_proxy_async - async def test_get(self, array_endpoint): + async def test_int32_value_get(self, array_endpoint): client = self.create_async_client(endpoint=array_endpoint) response = await client.int32_value.get() @@ -24,7 +24,7 @@ async def test_get(self, array_endpoint): @ArrayPreparer() @recorded_by_proxy_async - async def test_put(self, array_endpoint): + async def test_int32_value_put(self, array_endpoint): client = self.create_async_client(endpoint=array_endpoint) response = await client.int32_value.put( body=[0], diff --git a/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_int64_value_operations.py b/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_int64_value_operations.py index 67150d988e7..f7e0c27b1c4 100644 --- a/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_int64_value_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_int64_value_operations.py @@ -14,7 +14,7 @@ class TestArrayInt64ValueOperations(ArrayClientTestBase): @ArrayPreparer() @recorded_by_proxy - def test_get(self, array_endpoint): + def test_int64_value_get(self, array_endpoint): client = self.create_client(endpoint=array_endpoint) response = client.int64_value.get() @@ -23,7 +23,7 @@ def test_get(self, array_endpoint): @ArrayPreparer() @recorded_by_proxy - def test_put(self, array_endpoint): + def test_int64_value_put(self, array_endpoint): client = self.create_client(endpoint=array_endpoint) response = client.int64_value.put( body=[0], diff --git a/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_int64_value_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_int64_value_operations_async.py index ba3cc743cec..0a65a3409bc 100644 --- a/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_int64_value_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_int64_value_operations_async.py @@ -15,7 +15,7 @@ class TestArrayInt64ValueOperationsAsync(ArrayClientTestBaseAsync): @ArrayPreparer() @recorded_by_proxy_async - async def test_get(self, array_endpoint): + async def test_int64_value_get(self, array_endpoint): client = self.create_async_client(endpoint=array_endpoint) response = await client.int64_value.get() @@ -24,7 +24,7 @@ async def test_get(self, array_endpoint): @ArrayPreparer() @recorded_by_proxy_async - async def test_put(self, array_endpoint): + async def test_int64_value_put(self, array_endpoint): client = self.create_async_client(endpoint=array_endpoint) response = await client.int64_value.put( body=[0], diff --git a/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_model_value_operations.py b/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_model_value_operations.py index b89d21fe467..902a16cc99b 100644 --- a/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_model_value_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_model_value_operations.py @@ -14,7 +14,7 @@ class TestArrayModelValueOperations(ArrayClientTestBase): @ArrayPreparer() @recorded_by_proxy - def test_get(self, array_endpoint): + def test_model_value_get(self, array_endpoint): client = self.create_client(endpoint=array_endpoint) response = client.model_value.get() @@ -23,7 +23,7 @@ def test_get(self, array_endpoint): @ArrayPreparer() @recorded_by_proxy - def test_put(self, array_endpoint): + def test_model_value_put(self, array_endpoint): client = self.create_client(endpoint=array_endpoint) response = client.model_value.put( body=[{"property": "str", "children": [...]}], diff --git a/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_model_value_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_model_value_operations_async.py index 1ab1007800d..3f3fd3c8302 100644 --- a/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_model_value_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_model_value_operations_async.py @@ -15,7 +15,7 @@ class TestArrayModelValueOperationsAsync(ArrayClientTestBaseAsync): @ArrayPreparer() @recorded_by_proxy_async - async def test_get(self, array_endpoint): + async def test_model_value_get(self, array_endpoint): client = self.create_async_client(endpoint=array_endpoint) response = await client.model_value.get() @@ -24,7 +24,7 @@ async def test_get(self, array_endpoint): @ArrayPreparer() @recorded_by_proxy_async - async def test_put(self, array_endpoint): + async def test_model_value_put(self, array_endpoint): client = self.create_async_client(endpoint=array_endpoint) response = await client.model_value.put( body=[{"property": "str", "children": [...]}], diff --git a/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_nullable_boolean_value_operations.py b/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_nullable_boolean_value_operations.py index 2051e5d1710..424edfcac74 100644 --- a/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_nullable_boolean_value_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_nullable_boolean_value_operations.py @@ -14,7 +14,7 @@ class TestArrayNullableBooleanValueOperations(ArrayClientTestBase): @ArrayPreparer() @recorded_by_proxy - def test_get(self, array_endpoint): + def test_nullable_boolean_value_get(self, array_endpoint): client = self.create_client(endpoint=array_endpoint) response = client.nullable_boolean_value.get() @@ -23,7 +23,7 @@ def test_get(self, array_endpoint): @ArrayPreparer() @recorded_by_proxy - def test_put(self, array_endpoint): + def test_nullable_boolean_value_put(self, array_endpoint): client = self.create_client(endpoint=array_endpoint) response = client.nullable_boolean_value.put( body=[bool], diff --git a/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_nullable_boolean_value_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_nullable_boolean_value_operations_async.py index 9b653c8cc56..00f98afecd6 100644 --- a/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_nullable_boolean_value_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_nullable_boolean_value_operations_async.py @@ -15,7 +15,7 @@ class TestArrayNullableBooleanValueOperationsAsync(ArrayClientTestBaseAsync): @ArrayPreparer() @recorded_by_proxy_async - async def test_get(self, array_endpoint): + async def test_nullable_boolean_value_get(self, array_endpoint): client = self.create_async_client(endpoint=array_endpoint) response = await client.nullable_boolean_value.get() @@ -24,7 +24,7 @@ async def test_get(self, array_endpoint): @ArrayPreparer() @recorded_by_proxy_async - async def test_put(self, array_endpoint): + async def test_nullable_boolean_value_put(self, array_endpoint): client = self.create_async_client(endpoint=array_endpoint) response = await client.nullable_boolean_value.put( body=[bool], diff --git a/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_nullable_float_value_operations.py b/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_nullable_float_value_operations.py index 60256912bb9..22e6eb6f081 100644 --- a/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_nullable_float_value_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_nullable_float_value_operations.py @@ -14,7 +14,7 @@ class TestArrayNullableFloatValueOperations(ArrayClientTestBase): @ArrayPreparer() @recorded_by_proxy - def test_get(self, array_endpoint): + def test_nullable_float_value_get(self, array_endpoint): client = self.create_client(endpoint=array_endpoint) response = client.nullable_float_value.get() @@ -23,7 +23,7 @@ def test_get(self, array_endpoint): @ArrayPreparer() @recorded_by_proxy - def test_put(self, array_endpoint): + def test_nullable_float_value_put(self, array_endpoint): client = self.create_client(endpoint=array_endpoint) response = client.nullable_float_value.put( body=[0.0], diff --git a/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_nullable_float_value_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_nullable_float_value_operations_async.py index 35449e32de2..51eb6323a14 100644 --- a/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_nullable_float_value_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_nullable_float_value_operations_async.py @@ -15,7 +15,7 @@ class TestArrayNullableFloatValueOperationsAsync(ArrayClientTestBaseAsync): @ArrayPreparer() @recorded_by_proxy_async - async def test_get(self, array_endpoint): + async def test_nullable_float_value_get(self, array_endpoint): client = self.create_async_client(endpoint=array_endpoint) response = await client.nullable_float_value.get() @@ -24,7 +24,7 @@ async def test_get(self, array_endpoint): @ArrayPreparer() @recorded_by_proxy_async - async def test_put(self, array_endpoint): + async def test_nullable_float_value_put(self, array_endpoint): client = self.create_async_client(endpoint=array_endpoint) response = await client.nullable_float_value.put( body=[0.0], diff --git a/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_nullable_int32_value_operations.py b/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_nullable_int32_value_operations.py index dcca8c1c094..b15da9d989f 100644 --- a/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_nullable_int32_value_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_nullable_int32_value_operations.py @@ -14,7 +14,7 @@ class TestArrayNullableInt32ValueOperations(ArrayClientTestBase): @ArrayPreparer() @recorded_by_proxy - def test_get(self, array_endpoint): + def test_nullable_int32_value_get(self, array_endpoint): client = self.create_client(endpoint=array_endpoint) response = client.nullable_int32_value.get() @@ -23,7 +23,7 @@ def test_get(self, array_endpoint): @ArrayPreparer() @recorded_by_proxy - def test_put(self, array_endpoint): + def test_nullable_int32_value_put(self, array_endpoint): client = self.create_client(endpoint=array_endpoint) response = client.nullable_int32_value.put( body=[0], diff --git a/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_nullable_int32_value_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_nullable_int32_value_operations_async.py index f7ad8dab8a1..99ab79992ad 100644 --- a/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_nullable_int32_value_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_nullable_int32_value_operations_async.py @@ -15,7 +15,7 @@ class TestArrayNullableInt32ValueOperationsAsync(ArrayClientTestBaseAsync): @ArrayPreparer() @recorded_by_proxy_async - async def test_get(self, array_endpoint): + async def test_nullable_int32_value_get(self, array_endpoint): client = self.create_async_client(endpoint=array_endpoint) response = await client.nullable_int32_value.get() @@ -24,7 +24,7 @@ async def test_get(self, array_endpoint): @ArrayPreparer() @recorded_by_proxy_async - async def test_put(self, array_endpoint): + async def test_nullable_int32_value_put(self, array_endpoint): client = self.create_async_client(endpoint=array_endpoint) response = await client.nullable_int32_value.put( body=[0], diff --git a/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_nullable_model_value_operations.py b/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_nullable_model_value_operations.py index 8620141f4c6..5af02b802ea 100644 --- a/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_nullable_model_value_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_nullable_model_value_operations.py @@ -14,7 +14,7 @@ class TestArrayNullableModelValueOperations(ArrayClientTestBase): @ArrayPreparer() @recorded_by_proxy - def test_get(self, array_endpoint): + def test_nullable_model_value_get(self, array_endpoint): client = self.create_client(endpoint=array_endpoint) response = client.nullable_model_value.get() @@ -23,7 +23,7 @@ def test_get(self, array_endpoint): @ArrayPreparer() @recorded_by_proxy - def test_put(self, array_endpoint): + def test_nullable_model_value_put(self, array_endpoint): client = self.create_client(endpoint=array_endpoint) response = client.nullable_model_value.put( body=[{"property": "str", "children": [...]}], diff --git a/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_nullable_model_value_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_nullable_model_value_operations_async.py index 423b70b4a7d..add8c12e990 100644 --- a/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_nullable_model_value_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_nullable_model_value_operations_async.py @@ -15,7 +15,7 @@ class TestArrayNullableModelValueOperationsAsync(ArrayClientTestBaseAsync): @ArrayPreparer() @recorded_by_proxy_async - async def test_get(self, array_endpoint): + async def test_nullable_model_value_get(self, array_endpoint): client = self.create_async_client(endpoint=array_endpoint) response = await client.nullable_model_value.get() @@ -24,7 +24,7 @@ async def test_get(self, array_endpoint): @ArrayPreparer() @recorded_by_proxy_async - async def test_put(self, array_endpoint): + async def test_nullable_model_value_put(self, array_endpoint): client = self.create_async_client(endpoint=array_endpoint) response = await client.nullable_model_value.put( body=[{"property": "str", "children": [...]}], diff --git a/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_nullable_string_value_operations.py b/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_nullable_string_value_operations.py index da3f8fcb5b2..6f822baef0c 100644 --- a/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_nullable_string_value_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_nullable_string_value_operations.py @@ -14,7 +14,7 @@ class TestArrayNullableStringValueOperations(ArrayClientTestBase): @ArrayPreparer() @recorded_by_proxy - def test_get(self, array_endpoint): + def test_nullable_string_value_get(self, array_endpoint): client = self.create_client(endpoint=array_endpoint) response = client.nullable_string_value.get() @@ -23,7 +23,7 @@ def test_get(self, array_endpoint): @ArrayPreparer() @recorded_by_proxy - def test_put(self, array_endpoint): + def test_nullable_string_value_put(self, array_endpoint): client = self.create_client(endpoint=array_endpoint) response = client.nullable_string_value.put( body=["str"], diff --git a/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_nullable_string_value_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_nullable_string_value_operations_async.py index 579748b8726..872997efda8 100644 --- a/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_nullable_string_value_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_nullable_string_value_operations_async.py @@ -15,7 +15,7 @@ class TestArrayNullableStringValueOperationsAsync(ArrayClientTestBaseAsync): @ArrayPreparer() @recorded_by_proxy_async - async def test_get(self, array_endpoint): + async def test_nullable_string_value_get(self, array_endpoint): client = self.create_async_client(endpoint=array_endpoint) response = await client.nullable_string_value.get() @@ -24,7 +24,7 @@ async def test_get(self, array_endpoint): @ArrayPreparer() @recorded_by_proxy_async - async def test_put(self, array_endpoint): + async def test_nullable_string_value_put(self, array_endpoint): client = self.create_async_client(endpoint=array_endpoint) response = await client.nullable_string_value.put( body=["str"], diff --git a/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_string_value_operations.py b/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_string_value_operations.py index 5bcab833447..88918304f26 100644 --- a/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_string_value_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_string_value_operations.py @@ -14,7 +14,7 @@ class TestArrayStringValueOperations(ArrayClientTestBase): @ArrayPreparer() @recorded_by_proxy - def test_get(self, array_endpoint): + def test_string_value_get(self, array_endpoint): client = self.create_client(endpoint=array_endpoint) response = client.string_value.get() @@ -23,7 +23,7 @@ def test_get(self, array_endpoint): @ArrayPreparer() @recorded_by_proxy - def test_put(self, array_endpoint): + def test_string_value_put(self, array_endpoint): client = self.create_client(endpoint=array_endpoint) response = client.string_value.put( body=["str"], diff --git a/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_string_value_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_string_value_operations_async.py index 8692f1b1b0a..fd99dcd54fc 100644 --- a/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_string_value_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_string_value_operations_async.py @@ -15,7 +15,7 @@ class TestArrayStringValueOperationsAsync(ArrayClientTestBaseAsync): @ArrayPreparer() @recorded_by_proxy_async - async def test_get(self, array_endpoint): + async def test_string_value_get(self, array_endpoint): client = self.create_async_client(endpoint=array_endpoint) response = await client.string_value.get() @@ -24,7 +24,7 @@ async def test_get(self, array_endpoint): @ArrayPreparer() @recorded_by_proxy_async - async def test_put(self, array_endpoint): + async def test_string_value_put(self, array_endpoint): client = self.create_async_client(endpoint=array_endpoint) response = await client.string_value.put( body=["str"], diff --git a/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_unknown_value_operations.py b/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_unknown_value_operations.py index d3f091a8545..2a018ba6fa0 100644 --- a/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_unknown_value_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_unknown_value_operations.py @@ -14,7 +14,7 @@ class TestArrayUnknownValueOperations(ArrayClientTestBase): @ArrayPreparer() @recorded_by_proxy - def test_get(self, array_endpoint): + def test_unknown_value_get(self, array_endpoint): client = self.create_client(endpoint=array_endpoint) response = client.unknown_value.get() @@ -23,7 +23,7 @@ def test_get(self, array_endpoint): @ArrayPreparer() @recorded_by_proxy - def test_put(self, array_endpoint): + def test_unknown_value_put(self, array_endpoint): client = self.create_client(endpoint=array_endpoint) response = client.unknown_value.put( body=[{}], diff --git a/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_unknown_value_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_unknown_value_operations_async.py index 5ff45e4f8bf..ffbc2d2c7df 100644 --- a/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_unknown_value_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-array/generated_tests/test_array_unknown_value_operations_async.py @@ -15,7 +15,7 @@ class TestArrayUnknownValueOperationsAsync(ArrayClientTestBaseAsync): @ArrayPreparer() @recorded_by_proxy_async - async def test_get(self, array_endpoint): + async def test_unknown_value_get(self, array_endpoint): client = self.create_async_client(endpoint=array_endpoint) response = await client.unknown_value.get() @@ -24,7 +24,7 @@ async def test_get(self, array_endpoint): @ArrayPreparer() @recorded_by_proxy_async - async def test_put(self, array_endpoint): + async def test_unknown_value_put(self, array_endpoint): client = self.create_async_client(endpoint=array_endpoint) response = await client.unknown_value.put( body=[{}], diff --git a/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_boolean_value_operations.py b/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_boolean_value_operations.py index acfde548cf7..066f228c89a 100644 --- a/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_boolean_value_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_boolean_value_operations.py @@ -14,7 +14,7 @@ class TestDictionaryBooleanValueOperations(DictionaryClientTestBase): @DictionaryPreparer() @recorded_by_proxy - def test_get(self, dictionary_endpoint): + def test_boolean_value_get(self, dictionary_endpoint): client = self.create_client(endpoint=dictionary_endpoint) response = client.boolean_value.get() @@ -23,7 +23,7 @@ def test_get(self, dictionary_endpoint): @DictionaryPreparer() @recorded_by_proxy - def test_put(self, dictionary_endpoint): + def test_boolean_value_put(self, dictionary_endpoint): client = self.create_client(endpoint=dictionary_endpoint) response = client.boolean_value.put( body={"str": bool}, diff --git a/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_boolean_value_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_boolean_value_operations_async.py index 38e34e9b7ae..ea0403b733d 100644 --- a/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_boolean_value_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_boolean_value_operations_async.py @@ -15,7 +15,7 @@ class TestDictionaryBooleanValueOperationsAsync(DictionaryClientTestBaseAsync): @DictionaryPreparer() @recorded_by_proxy_async - async def test_get(self, dictionary_endpoint): + async def test_boolean_value_get(self, dictionary_endpoint): client = self.create_async_client(endpoint=dictionary_endpoint) response = await client.boolean_value.get() @@ -24,7 +24,7 @@ async def test_get(self, dictionary_endpoint): @DictionaryPreparer() @recorded_by_proxy_async - async def test_put(self, dictionary_endpoint): + async def test_boolean_value_put(self, dictionary_endpoint): client = self.create_async_client(endpoint=dictionary_endpoint) response = await client.boolean_value.put( body={"str": bool}, diff --git a/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_datetime_value_operations.py b/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_datetime_value_operations.py index 94a0b89b5cc..30fb62304ce 100644 --- a/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_datetime_value_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_datetime_value_operations.py @@ -14,7 +14,7 @@ class TestDictionaryDatetimeValueOperations(DictionaryClientTestBase): @DictionaryPreparer() @recorded_by_proxy - def test_get(self, dictionary_endpoint): + def test_datetime_value_get(self, dictionary_endpoint): client = self.create_client(endpoint=dictionary_endpoint) response = client.datetime_value.get() @@ -23,7 +23,7 @@ def test_get(self, dictionary_endpoint): @DictionaryPreparer() @recorded_by_proxy - def test_put(self, dictionary_endpoint): + def test_datetime_value_put(self, dictionary_endpoint): client = self.create_client(endpoint=dictionary_endpoint) response = client.datetime_value.put( body={"str": "2020-02-20 00:00:00"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_datetime_value_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_datetime_value_operations_async.py index 37f41ec6054..3e83eefc827 100644 --- a/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_datetime_value_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_datetime_value_operations_async.py @@ -15,7 +15,7 @@ class TestDictionaryDatetimeValueOperationsAsync(DictionaryClientTestBaseAsync): @DictionaryPreparer() @recorded_by_proxy_async - async def test_get(self, dictionary_endpoint): + async def test_datetime_value_get(self, dictionary_endpoint): client = self.create_async_client(endpoint=dictionary_endpoint) response = await client.datetime_value.get() @@ -24,7 +24,7 @@ async def test_get(self, dictionary_endpoint): @DictionaryPreparer() @recorded_by_proxy_async - async def test_put(self, dictionary_endpoint): + async def test_datetime_value_put(self, dictionary_endpoint): client = self.create_async_client(endpoint=dictionary_endpoint) response = await client.datetime_value.put( body={"str": "2020-02-20 00:00:00"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_duration_value_operations.py b/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_duration_value_operations.py index cea99de796a..b0b3e702188 100644 --- a/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_duration_value_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_duration_value_operations.py @@ -14,7 +14,7 @@ class TestDictionaryDurationValueOperations(DictionaryClientTestBase): @DictionaryPreparer() @recorded_by_proxy - def test_get(self, dictionary_endpoint): + def test_duration_value_get(self, dictionary_endpoint): client = self.create_client(endpoint=dictionary_endpoint) response = client.duration_value.get() @@ -23,7 +23,7 @@ def test_get(self, dictionary_endpoint): @DictionaryPreparer() @recorded_by_proxy - def test_put(self, dictionary_endpoint): + def test_duration_value_put(self, dictionary_endpoint): client = self.create_client(endpoint=dictionary_endpoint) response = client.duration_value.put( body={"str": "1 day, 0:00:00"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_duration_value_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_duration_value_operations_async.py index 4e2c6f1736e..0d5394008dd 100644 --- a/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_duration_value_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_duration_value_operations_async.py @@ -15,7 +15,7 @@ class TestDictionaryDurationValueOperationsAsync(DictionaryClientTestBaseAsync): @DictionaryPreparer() @recorded_by_proxy_async - async def test_get(self, dictionary_endpoint): + async def test_duration_value_get(self, dictionary_endpoint): client = self.create_async_client(endpoint=dictionary_endpoint) response = await client.duration_value.get() @@ -24,7 +24,7 @@ async def test_get(self, dictionary_endpoint): @DictionaryPreparer() @recorded_by_proxy_async - async def test_put(self, dictionary_endpoint): + async def test_duration_value_put(self, dictionary_endpoint): client = self.create_async_client(endpoint=dictionary_endpoint) response = await client.duration_value.put( body={"str": "1 day, 0:00:00"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_float32_value_operations.py b/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_float32_value_operations.py index 16a53efeaae..859239e7348 100644 --- a/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_float32_value_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_float32_value_operations.py @@ -14,7 +14,7 @@ class TestDictionaryFloat32ValueOperations(DictionaryClientTestBase): @DictionaryPreparer() @recorded_by_proxy - def test_get(self, dictionary_endpoint): + def test_float32_value_get(self, dictionary_endpoint): client = self.create_client(endpoint=dictionary_endpoint) response = client.float32_value.get() @@ -23,7 +23,7 @@ def test_get(self, dictionary_endpoint): @DictionaryPreparer() @recorded_by_proxy - def test_put(self, dictionary_endpoint): + def test_float32_value_put(self, dictionary_endpoint): client = self.create_client(endpoint=dictionary_endpoint) response = client.float32_value.put( body={"str": 0.0}, diff --git a/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_float32_value_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_float32_value_operations_async.py index 55d4e6c935d..a52a03e857f 100644 --- a/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_float32_value_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_float32_value_operations_async.py @@ -15,7 +15,7 @@ class TestDictionaryFloat32ValueOperationsAsync(DictionaryClientTestBaseAsync): @DictionaryPreparer() @recorded_by_proxy_async - async def test_get(self, dictionary_endpoint): + async def test_float32_value_get(self, dictionary_endpoint): client = self.create_async_client(endpoint=dictionary_endpoint) response = await client.float32_value.get() @@ -24,7 +24,7 @@ async def test_get(self, dictionary_endpoint): @DictionaryPreparer() @recorded_by_proxy_async - async def test_put(self, dictionary_endpoint): + async def test_float32_value_put(self, dictionary_endpoint): client = self.create_async_client(endpoint=dictionary_endpoint) response = await client.float32_value.put( body={"str": 0.0}, diff --git a/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_int32_value_operations.py b/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_int32_value_operations.py index d650efe29ee..a2199a45778 100644 --- a/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_int32_value_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_int32_value_operations.py @@ -14,7 +14,7 @@ class TestDictionaryInt32ValueOperations(DictionaryClientTestBase): @DictionaryPreparer() @recorded_by_proxy - def test_get(self, dictionary_endpoint): + def test_int32_value_get(self, dictionary_endpoint): client = self.create_client(endpoint=dictionary_endpoint) response = client.int32_value.get() @@ -23,7 +23,7 @@ def test_get(self, dictionary_endpoint): @DictionaryPreparer() @recorded_by_proxy - def test_put(self, dictionary_endpoint): + def test_int32_value_put(self, dictionary_endpoint): client = self.create_client(endpoint=dictionary_endpoint) response = client.int32_value.put( body={"str": 0}, diff --git a/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_int32_value_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_int32_value_operations_async.py index 15e3fc47cfe..77d4bb4577d 100644 --- a/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_int32_value_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_int32_value_operations_async.py @@ -15,7 +15,7 @@ class TestDictionaryInt32ValueOperationsAsync(DictionaryClientTestBaseAsync): @DictionaryPreparer() @recorded_by_proxy_async - async def test_get(self, dictionary_endpoint): + async def test_int32_value_get(self, dictionary_endpoint): client = self.create_async_client(endpoint=dictionary_endpoint) response = await client.int32_value.get() @@ -24,7 +24,7 @@ async def test_get(self, dictionary_endpoint): @DictionaryPreparer() @recorded_by_proxy_async - async def test_put(self, dictionary_endpoint): + async def test_int32_value_put(self, dictionary_endpoint): client = self.create_async_client(endpoint=dictionary_endpoint) response = await client.int32_value.put( body={"str": 0}, diff --git a/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_int64_value_operations.py b/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_int64_value_operations.py index 5993ec10d19..6f7322982d7 100644 --- a/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_int64_value_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_int64_value_operations.py @@ -14,7 +14,7 @@ class TestDictionaryInt64ValueOperations(DictionaryClientTestBase): @DictionaryPreparer() @recorded_by_proxy - def test_get(self, dictionary_endpoint): + def test_int64_value_get(self, dictionary_endpoint): client = self.create_client(endpoint=dictionary_endpoint) response = client.int64_value.get() @@ -23,7 +23,7 @@ def test_get(self, dictionary_endpoint): @DictionaryPreparer() @recorded_by_proxy - def test_put(self, dictionary_endpoint): + def test_int64_value_put(self, dictionary_endpoint): client = self.create_client(endpoint=dictionary_endpoint) response = client.int64_value.put( body={"str": 0}, diff --git a/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_int64_value_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_int64_value_operations_async.py index 2f7d189d7c0..12b6e15ef77 100644 --- a/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_int64_value_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_int64_value_operations_async.py @@ -15,7 +15,7 @@ class TestDictionaryInt64ValueOperationsAsync(DictionaryClientTestBaseAsync): @DictionaryPreparer() @recorded_by_proxy_async - async def test_get(self, dictionary_endpoint): + async def test_int64_value_get(self, dictionary_endpoint): client = self.create_async_client(endpoint=dictionary_endpoint) response = await client.int64_value.get() @@ -24,7 +24,7 @@ async def test_get(self, dictionary_endpoint): @DictionaryPreparer() @recorded_by_proxy_async - async def test_put(self, dictionary_endpoint): + async def test_int64_value_put(self, dictionary_endpoint): client = self.create_async_client(endpoint=dictionary_endpoint) response = await client.int64_value.put( body={"str": 0}, diff --git a/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_model_value_operations.py b/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_model_value_operations.py index ae911a65650..040afe8e20b 100644 --- a/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_model_value_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_model_value_operations.py @@ -14,7 +14,7 @@ class TestDictionaryModelValueOperations(DictionaryClientTestBase): @DictionaryPreparer() @recorded_by_proxy - def test_get(self, dictionary_endpoint): + def test_model_value_get(self, dictionary_endpoint): client = self.create_client(endpoint=dictionary_endpoint) response = client.model_value.get() @@ -23,7 +23,7 @@ def test_get(self, dictionary_endpoint): @DictionaryPreparer() @recorded_by_proxy - def test_put(self, dictionary_endpoint): + def test_model_value_put(self, dictionary_endpoint): client = self.create_client(endpoint=dictionary_endpoint) response = client.model_value.put( body={"str": {"property": "str", "children": {"str": ...}}}, diff --git a/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_model_value_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_model_value_operations_async.py index 1f190ddc8b9..54fbc74db5b 100644 --- a/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_model_value_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_model_value_operations_async.py @@ -15,7 +15,7 @@ class TestDictionaryModelValueOperationsAsync(DictionaryClientTestBaseAsync): @DictionaryPreparer() @recorded_by_proxy_async - async def test_get(self, dictionary_endpoint): + async def test_model_value_get(self, dictionary_endpoint): client = self.create_async_client(endpoint=dictionary_endpoint) response = await client.model_value.get() @@ -24,7 +24,7 @@ async def test_get(self, dictionary_endpoint): @DictionaryPreparer() @recorded_by_proxy_async - async def test_put(self, dictionary_endpoint): + async def test_model_value_put(self, dictionary_endpoint): client = self.create_async_client(endpoint=dictionary_endpoint) response = await client.model_value.put( body={"str": {"property": "str", "children": {"str": ...}}}, diff --git a/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_nullable_float_value_operations.py b/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_nullable_float_value_operations.py index c9917f6da04..3f17f0f6982 100644 --- a/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_nullable_float_value_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_nullable_float_value_operations.py @@ -14,7 +14,7 @@ class TestDictionaryNullableFloatValueOperations(DictionaryClientTestBase): @DictionaryPreparer() @recorded_by_proxy - def test_get(self, dictionary_endpoint): + def test_nullable_float_value_get(self, dictionary_endpoint): client = self.create_client(endpoint=dictionary_endpoint) response = client.nullable_float_value.get() @@ -23,7 +23,7 @@ def test_get(self, dictionary_endpoint): @DictionaryPreparer() @recorded_by_proxy - def test_put(self, dictionary_endpoint): + def test_nullable_float_value_put(self, dictionary_endpoint): client = self.create_client(endpoint=dictionary_endpoint) response = client.nullable_float_value.put( body={"str": 0.0}, diff --git a/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_nullable_float_value_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_nullable_float_value_operations_async.py index e7bb00692b7..1e8f5f07b35 100644 --- a/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_nullable_float_value_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_nullable_float_value_operations_async.py @@ -15,7 +15,7 @@ class TestDictionaryNullableFloatValueOperationsAsync(DictionaryClientTestBaseAsync): @DictionaryPreparer() @recorded_by_proxy_async - async def test_get(self, dictionary_endpoint): + async def test_nullable_float_value_get(self, dictionary_endpoint): client = self.create_async_client(endpoint=dictionary_endpoint) response = await client.nullable_float_value.get() @@ -24,7 +24,7 @@ async def test_get(self, dictionary_endpoint): @DictionaryPreparer() @recorded_by_proxy_async - async def test_put(self, dictionary_endpoint): + async def test_nullable_float_value_put(self, dictionary_endpoint): client = self.create_async_client(endpoint=dictionary_endpoint) response = await client.nullable_float_value.put( body={"str": 0.0}, diff --git a/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_recursive_model_value_operations.py b/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_recursive_model_value_operations.py index dd0e86795d2..fe00987385c 100644 --- a/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_recursive_model_value_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_recursive_model_value_operations.py @@ -14,7 +14,7 @@ class TestDictionaryRecursiveModelValueOperations(DictionaryClientTestBase): @DictionaryPreparer() @recorded_by_proxy - def test_get(self, dictionary_endpoint): + def test_recursive_model_value_get(self, dictionary_endpoint): client = self.create_client(endpoint=dictionary_endpoint) response = client.recursive_model_value.get() @@ -23,7 +23,7 @@ def test_get(self, dictionary_endpoint): @DictionaryPreparer() @recorded_by_proxy - def test_put(self, dictionary_endpoint): + def test_recursive_model_value_put(self, dictionary_endpoint): client = self.create_client(endpoint=dictionary_endpoint) response = client.recursive_model_value.put( body={"str": {"property": "str", "children": {"str": ...}}}, diff --git a/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_recursive_model_value_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_recursive_model_value_operations_async.py index b33224c9634..63ed9c3ca9f 100644 --- a/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_recursive_model_value_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_recursive_model_value_operations_async.py @@ -15,7 +15,7 @@ class TestDictionaryRecursiveModelValueOperationsAsync(DictionaryClientTestBaseAsync): @DictionaryPreparer() @recorded_by_proxy_async - async def test_get(self, dictionary_endpoint): + async def test_recursive_model_value_get(self, dictionary_endpoint): client = self.create_async_client(endpoint=dictionary_endpoint) response = await client.recursive_model_value.get() @@ -24,7 +24,7 @@ async def test_get(self, dictionary_endpoint): @DictionaryPreparer() @recorded_by_proxy_async - async def test_put(self, dictionary_endpoint): + async def test_recursive_model_value_put(self, dictionary_endpoint): client = self.create_async_client(endpoint=dictionary_endpoint) response = await client.recursive_model_value.put( body={"str": {"property": "str", "children": {"str": ...}}}, diff --git a/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_string_value_operations.py b/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_string_value_operations.py index 946c95a3c75..6309558db05 100644 --- a/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_string_value_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_string_value_operations.py @@ -14,7 +14,7 @@ class TestDictionaryStringValueOperations(DictionaryClientTestBase): @DictionaryPreparer() @recorded_by_proxy - def test_get(self, dictionary_endpoint): + def test_string_value_get(self, dictionary_endpoint): client = self.create_client(endpoint=dictionary_endpoint) response = client.string_value.get() @@ -23,7 +23,7 @@ def test_get(self, dictionary_endpoint): @DictionaryPreparer() @recorded_by_proxy - def test_put(self, dictionary_endpoint): + def test_string_value_put(self, dictionary_endpoint): client = self.create_client(endpoint=dictionary_endpoint) response = client.string_value.put( body={"str": "str"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_string_value_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_string_value_operations_async.py index d1f34f5101c..91fdb59db9f 100644 --- a/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_string_value_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_string_value_operations_async.py @@ -15,7 +15,7 @@ class TestDictionaryStringValueOperationsAsync(DictionaryClientTestBaseAsync): @DictionaryPreparer() @recorded_by_proxy_async - async def test_get(self, dictionary_endpoint): + async def test_string_value_get(self, dictionary_endpoint): client = self.create_async_client(endpoint=dictionary_endpoint) response = await client.string_value.get() @@ -24,7 +24,7 @@ async def test_get(self, dictionary_endpoint): @DictionaryPreparer() @recorded_by_proxy_async - async def test_put(self, dictionary_endpoint): + async def test_string_value_put(self, dictionary_endpoint): client = self.create_async_client(endpoint=dictionary_endpoint) response = await client.string_value.put( body={"str": "str"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_unknown_value_operations.py b/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_unknown_value_operations.py index 49a5ba094c3..e84f0564e91 100644 --- a/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_unknown_value_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_unknown_value_operations.py @@ -14,7 +14,7 @@ class TestDictionaryUnknownValueOperations(DictionaryClientTestBase): @DictionaryPreparer() @recorded_by_proxy - def test_get(self, dictionary_endpoint): + def test_unknown_value_get(self, dictionary_endpoint): client = self.create_client(endpoint=dictionary_endpoint) response = client.unknown_value.get() @@ -23,7 +23,7 @@ def test_get(self, dictionary_endpoint): @DictionaryPreparer() @recorded_by_proxy - def test_put(self, dictionary_endpoint): + def test_unknown_value_put(self, dictionary_endpoint): client = self.create_client(endpoint=dictionary_endpoint) response = client.unknown_value.put( body={"str": {}}, diff --git a/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_unknown_value_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_unknown_value_operations_async.py index 95246e172cf..6bd7a2bf28a 100644 --- a/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_unknown_value_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-dictionary/generated_tests/test_dictionary_unknown_value_operations_async.py @@ -15,7 +15,7 @@ class TestDictionaryUnknownValueOperationsAsync(DictionaryClientTestBaseAsync): @DictionaryPreparer() @recorded_by_proxy_async - async def test_get(self, dictionary_endpoint): + async def test_unknown_value_get(self, dictionary_endpoint): client = self.create_async_client(endpoint=dictionary_endpoint) response = await client.unknown_value.get() @@ -24,7 +24,7 @@ async def test_get(self, dictionary_endpoint): @DictionaryPreparer() @recorded_by_proxy_async - async def test_put(self, dictionary_endpoint): + async def test_unknown_value_put(self, dictionary_endpoint): client = self.create_async_client(endpoint=dictionary_endpoint) response = await client.unknown_value.put( body={"str": {}}, diff --git a/packages/typespec-python/test/azure/generated/typetest-enum-extensible/generated_tests/test_extensible_string_operations.py b/packages/typespec-python/test/azure/generated/typetest-enum-extensible/generated_tests/test_extensible_string_operations.py index 18102dd6eea..be910b162cb 100644 --- a/packages/typespec-python/test/azure/generated/typetest-enum-extensible/generated_tests/test_extensible_string_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-enum-extensible/generated_tests/test_extensible_string_operations.py @@ -14,7 +14,7 @@ class TestExtensibleStringOperations(ExtensibleClientTestBase): @ExtensiblePreparer() @recorded_by_proxy - def test_get_known_value(self, extensible_endpoint): + def test_string_get_known_value(self, extensible_endpoint): client = self.create_client(endpoint=extensible_endpoint) response = client.string.get_known_value() @@ -23,7 +23,7 @@ def test_get_known_value(self, extensible_endpoint): @ExtensiblePreparer() @recorded_by_proxy - def test_get_unknown_value(self, extensible_endpoint): + def test_string_get_unknown_value(self, extensible_endpoint): client = self.create_client(endpoint=extensible_endpoint) response = client.string.get_unknown_value() @@ -32,7 +32,7 @@ def test_get_unknown_value(self, extensible_endpoint): @ExtensiblePreparer() @recorded_by_proxy - def test_put_known_value(self, extensible_endpoint): + def test_string_put_known_value(self, extensible_endpoint): client = self.create_client(endpoint=extensible_endpoint) response = client.string.put_known_value( body="str", @@ -44,7 +44,7 @@ def test_put_known_value(self, extensible_endpoint): @ExtensiblePreparer() @recorded_by_proxy - def test_put_unknown_value(self, extensible_endpoint): + def test_string_put_unknown_value(self, extensible_endpoint): client = self.create_client(endpoint=extensible_endpoint) response = client.string.put_unknown_value( body="str", diff --git a/packages/typespec-python/test/azure/generated/typetest-enum-extensible/generated_tests/test_extensible_string_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-enum-extensible/generated_tests/test_extensible_string_operations_async.py index 4af91607f5b..3e12585bf55 100644 --- a/packages/typespec-python/test/azure/generated/typetest-enum-extensible/generated_tests/test_extensible_string_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-enum-extensible/generated_tests/test_extensible_string_operations_async.py @@ -15,7 +15,7 @@ class TestExtensibleStringOperationsAsync(ExtensibleClientTestBaseAsync): @ExtensiblePreparer() @recorded_by_proxy_async - async def test_get_known_value(self, extensible_endpoint): + async def test_string_get_known_value(self, extensible_endpoint): client = self.create_async_client(endpoint=extensible_endpoint) response = await client.string.get_known_value() @@ -24,7 +24,7 @@ async def test_get_known_value(self, extensible_endpoint): @ExtensiblePreparer() @recorded_by_proxy_async - async def test_get_unknown_value(self, extensible_endpoint): + async def test_string_get_unknown_value(self, extensible_endpoint): client = self.create_async_client(endpoint=extensible_endpoint) response = await client.string.get_unknown_value() @@ -33,7 +33,7 @@ async def test_get_unknown_value(self, extensible_endpoint): @ExtensiblePreparer() @recorded_by_proxy_async - async def test_put_known_value(self, extensible_endpoint): + async def test_string_put_known_value(self, extensible_endpoint): client = self.create_async_client(endpoint=extensible_endpoint) response = await client.string.put_known_value( body="str", @@ -45,7 +45,7 @@ async def test_put_known_value(self, extensible_endpoint): @ExtensiblePreparer() @recorded_by_proxy_async - async def test_put_unknown_value(self, extensible_endpoint): + async def test_string_put_unknown_value(self, extensible_endpoint): client = self.create_async_client(endpoint=extensible_endpoint) response = await client.string.put_unknown_value( body="str", diff --git a/packages/typespec-python/test/azure/generated/typetest-enum-fixed/generated_tests/test_fixed_string_operations.py b/packages/typespec-python/test/azure/generated/typetest-enum-fixed/generated_tests/test_fixed_string_operations.py index 657016273a0..01f766ccb9c 100644 --- a/packages/typespec-python/test/azure/generated/typetest-enum-fixed/generated_tests/test_fixed_string_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-enum-fixed/generated_tests/test_fixed_string_operations.py @@ -14,7 +14,7 @@ class TestFixedStringOperations(FixedClientTestBase): @FixedPreparer() @recorded_by_proxy - def test_get_known_value(self, fixed_endpoint): + def test_string_get_known_value(self, fixed_endpoint): client = self.create_client(endpoint=fixed_endpoint) response = client.string.get_known_value() @@ -23,7 +23,7 @@ def test_get_known_value(self, fixed_endpoint): @FixedPreparer() @recorded_by_proxy - def test_put_known_value(self, fixed_endpoint): + def test_string_put_known_value(self, fixed_endpoint): client = self.create_client(endpoint=fixed_endpoint) response = client.string.put_known_value( body="str", @@ -35,7 +35,7 @@ def test_put_known_value(self, fixed_endpoint): @FixedPreparer() @recorded_by_proxy - def test_put_unknown_value(self, fixed_endpoint): + def test_string_put_unknown_value(self, fixed_endpoint): client = self.create_client(endpoint=fixed_endpoint) response = client.string.put_unknown_value( body="str", diff --git a/packages/typespec-python/test/azure/generated/typetest-enum-fixed/generated_tests/test_fixed_string_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-enum-fixed/generated_tests/test_fixed_string_operations_async.py index 33f8eaa8286..fd4a6d20c4c 100644 --- a/packages/typespec-python/test/azure/generated/typetest-enum-fixed/generated_tests/test_fixed_string_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-enum-fixed/generated_tests/test_fixed_string_operations_async.py @@ -15,7 +15,7 @@ class TestFixedStringOperationsAsync(FixedClientTestBaseAsync): @FixedPreparer() @recorded_by_proxy_async - async def test_get_known_value(self, fixed_endpoint): + async def test_string_get_known_value(self, fixed_endpoint): client = self.create_async_client(endpoint=fixed_endpoint) response = await client.string.get_known_value() @@ -24,7 +24,7 @@ async def test_get_known_value(self, fixed_endpoint): @FixedPreparer() @recorded_by_proxy_async - async def test_put_known_value(self, fixed_endpoint): + async def test_string_put_known_value(self, fixed_endpoint): client = self.create_async_client(endpoint=fixed_endpoint) response = await client.string.put_known_value( body="str", @@ -36,7 +36,7 @@ async def test_put_known_value(self, fixed_endpoint): @FixedPreparer() @recorded_by_proxy_async - async def test_put_unknown_value(self, fixed_endpoint): + async def test_string_put_unknown_value(self, fixed_endpoint): client = self.create_async_client(endpoint=fixed_endpoint) response = await client.string.put_unknown_value( body="str", diff --git a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_different_spread_float_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_different_spread_float_operations.py index 33a67b4adbc..bce95a06639 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_different_spread_float_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_different_spread_float_operations.py @@ -14,7 +14,7 @@ class TestAdditionalPropertiesExtendsDifferentSpreadFloatOperations(AdditionalPropertiesClientTestBase): @AdditionalPropertiesPreparer() @recorded_by_proxy - def test_get(self, additionalproperties_endpoint): + def test_extends_different_spread_float_get(self, additionalproperties_endpoint): client = self.create_client(endpoint=additionalproperties_endpoint) response = client.extends_different_spread_float.get() @@ -23,7 +23,7 @@ def test_get(self, additionalproperties_endpoint): @AdditionalPropertiesPreparer() @recorded_by_proxy - def test_put(self, additionalproperties_endpoint): + def test_extends_different_spread_float_put(self, additionalproperties_endpoint): client = self.create_client(endpoint=additionalproperties_endpoint) response = client.extends_different_spread_float.put( body={"derivedProp": 0.0, "name": "str"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_different_spread_float_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_different_spread_float_operations_async.py index e4dae3383a0..efbdeeb9588 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_different_spread_float_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_different_spread_float_operations_async.py @@ -15,7 +15,7 @@ class TestAdditionalPropertiesExtendsDifferentSpreadFloatOperationsAsync(AdditionalPropertiesClientTestBaseAsync): @AdditionalPropertiesPreparer() @recorded_by_proxy_async - async def test_get(self, additionalproperties_endpoint): + async def test_extends_different_spread_float_get(self, additionalproperties_endpoint): client = self.create_async_client(endpoint=additionalproperties_endpoint) response = await client.extends_different_spread_float.get() @@ -24,7 +24,7 @@ async def test_get(self, additionalproperties_endpoint): @AdditionalPropertiesPreparer() @recorded_by_proxy_async - async def test_put(self, additionalproperties_endpoint): + async def test_extends_different_spread_float_put(self, additionalproperties_endpoint): client = self.create_async_client(endpoint=additionalproperties_endpoint) response = await client.extends_different_spread_float.put( body={"derivedProp": 0.0, "name": "str"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_different_spread_model_array_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_different_spread_model_array_operations.py index c3c6d5b0f14..048d80dbb9e 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_different_spread_model_array_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_different_spread_model_array_operations.py @@ -14,7 +14,7 @@ class TestAdditionalPropertiesExtendsDifferentSpreadModelArrayOperations(AdditionalPropertiesClientTestBase): @AdditionalPropertiesPreparer() @recorded_by_proxy - def test_get(self, additionalproperties_endpoint): + def test_extends_different_spread_model_array_get(self, additionalproperties_endpoint): client = self.create_client(endpoint=additionalproperties_endpoint) response = client.extends_different_spread_model_array.get() @@ -23,7 +23,7 @@ def test_get(self, additionalproperties_endpoint): @AdditionalPropertiesPreparer() @recorded_by_proxy - def test_put(self, additionalproperties_endpoint): + def test_extends_different_spread_model_array_put(self, additionalproperties_endpoint): client = self.create_client(endpoint=additionalproperties_endpoint) response = client.extends_different_spread_model_array.put( body={"derivedProp": [{"state": "str"}], "knownProp": "str"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_different_spread_model_array_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_different_spread_model_array_operations_async.py index 31fabca349f..dad7cd099de 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_different_spread_model_array_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_different_spread_model_array_operations_async.py @@ -15,7 +15,7 @@ class TestAdditionalPropertiesExtendsDifferentSpreadModelArrayOperationsAsync(AdditionalPropertiesClientTestBaseAsync): @AdditionalPropertiesPreparer() @recorded_by_proxy_async - async def test_get(self, additionalproperties_endpoint): + async def test_extends_different_spread_model_array_get(self, additionalproperties_endpoint): client = self.create_async_client(endpoint=additionalproperties_endpoint) response = await client.extends_different_spread_model_array.get() @@ -24,7 +24,7 @@ async def test_get(self, additionalproperties_endpoint): @AdditionalPropertiesPreparer() @recorded_by_proxy_async - async def test_put(self, additionalproperties_endpoint): + async def test_extends_different_spread_model_array_put(self, additionalproperties_endpoint): client = self.create_async_client(endpoint=additionalproperties_endpoint) response = await client.extends_different_spread_model_array.put( body={"derivedProp": [{"state": "str"}], "knownProp": "str"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_different_spread_model_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_different_spread_model_operations.py index 6e592ad39e2..9a3ab0104f4 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_different_spread_model_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_different_spread_model_operations.py @@ -14,7 +14,7 @@ class TestAdditionalPropertiesExtendsDifferentSpreadModelOperations(AdditionalPropertiesClientTestBase): @AdditionalPropertiesPreparer() @recorded_by_proxy - def test_get(self, additionalproperties_endpoint): + def test_extends_different_spread_model_get(self, additionalproperties_endpoint): client = self.create_client(endpoint=additionalproperties_endpoint) response = client.extends_different_spread_model.get() @@ -23,7 +23,7 @@ def test_get(self, additionalproperties_endpoint): @AdditionalPropertiesPreparer() @recorded_by_proxy - def test_put(self, additionalproperties_endpoint): + def test_extends_different_spread_model_put(self, additionalproperties_endpoint): client = self.create_client(endpoint=additionalproperties_endpoint) response = client.extends_different_spread_model.put( body={"derivedProp": {"state": "str"}, "knownProp": "str"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_different_spread_model_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_different_spread_model_operations_async.py index e9a909b5797..eb9aed8f98e 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_different_spread_model_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_different_spread_model_operations_async.py @@ -15,7 +15,7 @@ class TestAdditionalPropertiesExtendsDifferentSpreadModelOperationsAsync(AdditionalPropertiesClientTestBaseAsync): @AdditionalPropertiesPreparer() @recorded_by_proxy_async - async def test_get(self, additionalproperties_endpoint): + async def test_extends_different_spread_model_get(self, additionalproperties_endpoint): client = self.create_async_client(endpoint=additionalproperties_endpoint) response = await client.extends_different_spread_model.get() @@ -24,7 +24,7 @@ async def test_get(self, additionalproperties_endpoint): @AdditionalPropertiesPreparer() @recorded_by_proxy_async - async def test_put(self, additionalproperties_endpoint): + async def test_extends_different_spread_model_put(self, additionalproperties_endpoint): client = self.create_async_client(endpoint=additionalproperties_endpoint) response = await client.extends_different_spread_model.put( body={"derivedProp": {"state": "str"}, "knownProp": "str"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_different_spread_string_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_different_spread_string_operations.py index f8d796c06b7..c2d8c804b7a 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_different_spread_string_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_different_spread_string_operations.py @@ -14,7 +14,7 @@ class TestAdditionalPropertiesExtendsDifferentSpreadStringOperations(AdditionalPropertiesClientTestBase): @AdditionalPropertiesPreparer() @recorded_by_proxy - def test_get(self, additionalproperties_endpoint): + def test_extends_different_spread_string_get(self, additionalproperties_endpoint): client = self.create_client(endpoint=additionalproperties_endpoint) response = client.extends_different_spread_string.get() @@ -23,7 +23,7 @@ def test_get(self, additionalproperties_endpoint): @AdditionalPropertiesPreparer() @recorded_by_proxy - def test_put(self, additionalproperties_endpoint): + def test_extends_different_spread_string_put(self, additionalproperties_endpoint): client = self.create_client(endpoint=additionalproperties_endpoint) response = client.extends_different_spread_string.put( body={"derivedProp": "str", "id": 0.0}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_different_spread_string_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_different_spread_string_operations_async.py index b3c7a4ef13a..117ae0ce9d0 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_different_spread_string_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_different_spread_string_operations_async.py @@ -15,7 +15,7 @@ class TestAdditionalPropertiesExtendsDifferentSpreadStringOperationsAsync(AdditionalPropertiesClientTestBaseAsync): @AdditionalPropertiesPreparer() @recorded_by_proxy_async - async def test_get(self, additionalproperties_endpoint): + async def test_extends_different_spread_string_get(self, additionalproperties_endpoint): client = self.create_async_client(endpoint=additionalproperties_endpoint) response = await client.extends_different_spread_string.get() @@ -24,7 +24,7 @@ async def test_get(self, additionalproperties_endpoint): @AdditionalPropertiesPreparer() @recorded_by_proxy_async - async def test_put(self, additionalproperties_endpoint): + async def test_extends_different_spread_string_put(self, additionalproperties_endpoint): client = self.create_async_client(endpoint=additionalproperties_endpoint) response = await client.extends_different_spread_string.put( body={"derivedProp": "str", "id": 0.0}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_float_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_float_operations.py index 9a9c6f1607b..9f7581b3d8c 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_float_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_float_operations.py @@ -14,7 +14,7 @@ class TestAdditionalPropertiesExtendsFloatOperations(AdditionalPropertiesClientTestBase): @AdditionalPropertiesPreparer() @recorded_by_proxy - def test_get(self, additionalproperties_endpoint): + def test_extends_float_get(self, additionalproperties_endpoint): client = self.create_client(endpoint=additionalproperties_endpoint) response = client.extends_float.get() @@ -23,7 +23,7 @@ def test_get(self, additionalproperties_endpoint): @AdditionalPropertiesPreparer() @recorded_by_proxy - def test_put(self, additionalproperties_endpoint): + def test_extends_float_put(self, additionalproperties_endpoint): client = self.create_client(endpoint=additionalproperties_endpoint) response = client.extends_float.put( body={"id": 0.0}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_float_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_float_operations_async.py index 7f4322eb245..737ed0bd682 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_float_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_float_operations_async.py @@ -15,7 +15,7 @@ class TestAdditionalPropertiesExtendsFloatOperationsAsync(AdditionalPropertiesClientTestBaseAsync): @AdditionalPropertiesPreparer() @recorded_by_proxy_async - async def test_get(self, additionalproperties_endpoint): + async def test_extends_float_get(self, additionalproperties_endpoint): client = self.create_async_client(endpoint=additionalproperties_endpoint) response = await client.extends_float.get() @@ -24,7 +24,7 @@ async def test_get(self, additionalproperties_endpoint): @AdditionalPropertiesPreparer() @recorded_by_proxy_async - async def test_put(self, additionalproperties_endpoint): + async def test_extends_float_put(self, additionalproperties_endpoint): client = self.create_async_client(endpoint=additionalproperties_endpoint) response = await client.extends_float.put( body={"id": 0.0}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_model_array_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_model_array_operations.py index cb0dcf811f2..6e539bb68c5 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_model_array_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_model_array_operations.py @@ -14,7 +14,7 @@ class TestAdditionalPropertiesExtendsModelArrayOperations(AdditionalPropertiesClientTestBase): @AdditionalPropertiesPreparer() @recorded_by_proxy - def test_get(self, additionalproperties_endpoint): + def test_extends_model_array_get(self, additionalproperties_endpoint): client = self.create_client(endpoint=additionalproperties_endpoint) response = client.extends_model_array.get() @@ -23,7 +23,7 @@ def test_get(self, additionalproperties_endpoint): @AdditionalPropertiesPreparer() @recorded_by_proxy - def test_put(self, additionalproperties_endpoint): + def test_extends_model_array_put(self, additionalproperties_endpoint): client = self.create_client(endpoint=additionalproperties_endpoint) response = client.extends_model_array.put( body={"knownProp": [{"state": "str"}]}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_model_array_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_model_array_operations_async.py index 690503c1957..1c0cb2da785 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_model_array_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_model_array_operations_async.py @@ -15,7 +15,7 @@ class TestAdditionalPropertiesExtendsModelArrayOperationsAsync(AdditionalPropertiesClientTestBaseAsync): @AdditionalPropertiesPreparer() @recorded_by_proxy_async - async def test_get(self, additionalproperties_endpoint): + async def test_extends_model_array_get(self, additionalproperties_endpoint): client = self.create_async_client(endpoint=additionalproperties_endpoint) response = await client.extends_model_array.get() @@ -24,7 +24,7 @@ async def test_get(self, additionalproperties_endpoint): @AdditionalPropertiesPreparer() @recorded_by_proxy_async - async def test_put(self, additionalproperties_endpoint): + async def test_extends_model_array_put(self, additionalproperties_endpoint): client = self.create_async_client(endpoint=additionalproperties_endpoint) response = await client.extends_model_array.put( body={"knownProp": [{"state": "str"}]}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_model_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_model_operations.py index 73af288268c..71f8be6216c 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_model_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_model_operations.py @@ -14,7 +14,7 @@ class TestAdditionalPropertiesExtendsModelOperations(AdditionalPropertiesClientTestBase): @AdditionalPropertiesPreparer() @recorded_by_proxy - def test_get(self, additionalproperties_endpoint): + def test_extends_model_get(self, additionalproperties_endpoint): client = self.create_client(endpoint=additionalproperties_endpoint) response = client.extends_model.get() @@ -23,7 +23,7 @@ def test_get(self, additionalproperties_endpoint): @AdditionalPropertiesPreparer() @recorded_by_proxy - def test_put(self, additionalproperties_endpoint): + def test_extends_model_put(self, additionalproperties_endpoint): client = self.create_client(endpoint=additionalproperties_endpoint) response = client.extends_model.put( body={"knownProp": {"state": "str"}}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_model_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_model_operations_async.py index 4f0cb66747b..1ed0b99ca3f 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_model_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_model_operations_async.py @@ -15,7 +15,7 @@ class TestAdditionalPropertiesExtendsModelOperationsAsync(AdditionalPropertiesClientTestBaseAsync): @AdditionalPropertiesPreparer() @recorded_by_proxy_async - async def test_get(self, additionalproperties_endpoint): + async def test_extends_model_get(self, additionalproperties_endpoint): client = self.create_async_client(endpoint=additionalproperties_endpoint) response = await client.extends_model.get() @@ -24,7 +24,7 @@ async def test_get(self, additionalproperties_endpoint): @AdditionalPropertiesPreparer() @recorded_by_proxy_async - async def test_put(self, additionalproperties_endpoint): + async def test_extends_model_put(self, additionalproperties_endpoint): client = self.create_async_client(endpoint=additionalproperties_endpoint) response = await client.extends_model.put( body={"knownProp": {"state": "str"}}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_string_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_string_operations.py index e72729efa43..ba56033e4af 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_string_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_string_operations.py @@ -14,7 +14,7 @@ class TestAdditionalPropertiesExtendsStringOperations(AdditionalPropertiesClientTestBase): @AdditionalPropertiesPreparer() @recorded_by_proxy - def test_get(self, additionalproperties_endpoint): + def test_extends_string_get(self, additionalproperties_endpoint): client = self.create_client(endpoint=additionalproperties_endpoint) response = client.extends_string.get() @@ -23,7 +23,7 @@ def test_get(self, additionalproperties_endpoint): @AdditionalPropertiesPreparer() @recorded_by_proxy - def test_put(self, additionalproperties_endpoint): + def test_extends_string_put(self, additionalproperties_endpoint): client = self.create_client(endpoint=additionalproperties_endpoint) response = client.extends_string.put( body={"name": "str"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_string_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_string_operations_async.py index 79c220b00cd..58e4e63d8ea 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_string_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_string_operations_async.py @@ -15,7 +15,7 @@ class TestAdditionalPropertiesExtendsStringOperationsAsync(AdditionalPropertiesClientTestBaseAsync): @AdditionalPropertiesPreparer() @recorded_by_proxy_async - async def test_get(self, additionalproperties_endpoint): + async def test_extends_string_get(self, additionalproperties_endpoint): client = self.create_async_client(endpoint=additionalproperties_endpoint) response = await client.extends_string.get() @@ -24,7 +24,7 @@ async def test_get(self, additionalproperties_endpoint): @AdditionalPropertiesPreparer() @recorded_by_proxy_async - async def test_put(self, additionalproperties_endpoint): + async def test_extends_string_put(self, additionalproperties_endpoint): client = self.create_async_client(endpoint=additionalproperties_endpoint) response = await client.extends_string.put( body={"name": "str"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_unknown_derived_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_unknown_derived_operations.py index b9026de2aa2..3a65da7a619 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_unknown_derived_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_unknown_derived_operations.py @@ -14,7 +14,7 @@ class TestAdditionalPropertiesExtendsUnknownDerivedOperations(AdditionalPropertiesClientTestBase): @AdditionalPropertiesPreparer() @recorded_by_proxy - def test_get(self, additionalproperties_endpoint): + def test_extends_unknown_derived_get(self, additionalproperties_endpoint): client = self.create_client(endpoint=additionalproperties_endpoint) response = client.extends_unknown_derived.get() @@ -23,7 +23,7 @@ def test_get(self, additionalproperties_endpoint): @AdditionalPropertiesPreparer() @recorded_by_proxy - def test_put(self, additionalproperties_endpoint): + def test_extends_unknown_derived_put(self, additionalproperties_endpoint): client = self.create_client(endpoint=additionalproperties_endpoint) response = client.extends_unknown_derived.put( body={"index": 0, "name": "str", "age": 0.0}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_unknown_derived_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_unknown_derived_operations_async.py index ed29fdeffac..ce20df60dc4 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_unknown_derived_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_unknown_derived_operations_async.py @@ -15,7 +15,7 @@ class TestAdditionalPropertiesExtendsUnknownDerivedOperationsAsync(AdditionalPropertiesClientTestBaseAsync): @AdditionalPropertiesPreparer() @recorded_by_proxy_async - async def test_get(self, additionalproperties_endpoint): + async def test_extends_unknown_derived_get(self, additionalproperties_endpoint): client = self.create_async_client(endpoint=additionalproperties_endpoint) response = await client.extends_unknown_derived.get() @@ -24,7 +24,7 @@ async def test_get(self, additionalproperties_endpoint): @AdditionalPropertiesPreparer() @recorded_by_proxy_async - async def test_put(self, additionalproperties_endpoint): + async def test_extends_unknown_derived_put(self, additionalproperties_endpoint): client = self.create_async_client(endpoint=additionalproperties_endpoint) response = await client.extends_unknown_derived.put( body={"index": 0, "name": "str", "age": 0.0}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_unknown_discriminated_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_unknown_discriminated_operations.py index c2abc698ae0..c0a56d2ff1a 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_unknown_discriminated_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_unknown_discriminated_operations.py @@ -14,7 +14,7 @@ class TestAdditionalPropertiesExtendsUnknownDiscriminatedOperations(AdditionalPropertiesClientTestBase): @AdditionalPropertiesPreparer() @recorded_by_proxy - def test_get(self, additionalproperties_endpoint): + def test_extends_unknown_discriminated_get(self, additionalproperties_endpoint): client = self.create_client(endpoint=additionalproperties_endpoint) response = client.extends_unknown_discriminated.get() @@ -23,7 +23,7 @@ def test_get(self, additionalproperties_endpoint): @AdditionalPropertiesPreparer() @recorded_by_proxy - def test_put(self, additionalproperties_endpoint): + def test_extends_unknown_discriminated_put(self, additionalproperties_endpoint): client = self.create_client(endpoint=additionalproperties_endpoint) response = client.extends_unknown_discriminated.put( body={"index": 0, "kind": "derived", "name": "str", "age": 0.0}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_unknown_discriminated_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_unknown_discriminated_operations_async.py index 40e21647498..ad6020d0192 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_unknown_discriminated_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_unknown_discriminated_operations_async.py @@ -15,7 +15,7 @@ class TestAdditionalPropertiesExtendsUnknownDiscriminatedOperationsAsync(AdditionalPropertiesClientTestBaseAsync): @AdditionalPropertiesPreparer() @recorded_by_proxy_async - async def test_get(self, additionalproperties_endpoint): + async def test_extends_unknown_discriminated_get(self, additionalproperties_endpoint): client = self.create_async_client(endpoint=additionalproperties_endpoint) response = await client.extends_unknown_discriminated.get() @@ -24,7 +24,7 @@ async def test_get(self, additionalproperties_endpoint): @AdditionalPropertiesPreparer() @recorded_by_proxy_async - async def test_put(self, additionalproperties_endpoint): + async def test_extends_unknown_discriminated_put(self, additionalproperties_endpoint): client = self.create_async_client(endpoint=additionalproperties_endpoint) response = await client.extends_unknown_discriminated.put( body={"index": 0, "kind": "derived", "name": "str", "age": 0.0}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_unknown_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_unknown_operations.py index 7b3cbd262dc..31c2bed53f2 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_unknown_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_unknown_operations.py @@ -14,7 +14,7 @@ class TestAdditionalPropertiesExtendsUnknownOperations(AdditionalPropertiesClientTestBase): @AdditionalPropertiesPreparer() @recorded_by_proxy - def test_get(self, additionalproperties_endpoint): + def test_extends_unknown_get(self, additionalproperties_endpoint): client = self.create_client(endpoint=additionalproperties_endpoint) response = client.extends_unknown.get() @@ -23,7 +23,7 @@ def test_get(self, additionalproperties_endpoint): @AdditionalPropertiesPreparer() @recorded_by_proxy - def test_put(self, additionalproperties_endpoint): + def test_extends_unknown_put(self, additionalproperties_endpoint): client = self.create_client(endpoint=additionalproperties_endpoint) response = client.extends_unknown.put( body={"name": "str"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_unknown_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_unknown_operations_async.py index 0ed08574392..83136a4fe7e 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_unknown_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_extends_unknown_operations_async.py @@ -15,7 +15,7 @@ class TestAdditionalPropertiesExtendsUnknownOperationsAsync(AdditionalPropertiesClientTestBaseAsync): @AdditionalPropertiesPreparer() @recorded_by_proxy_async - async def test_get(self, additionalproperties_endpoint): + async def test_extends_unknown_get(self, additionalproperties_endpoint): client = self.create_async_client(endpoint=additionalproperties_endpoint) response = await client.extends_unknown.get() @@ -24,7 +24,7 @@ async def test_get(self, additionalproperties_endpoint): @AdditionalPropertiesPreparer() @recorded_by_proxy_async - async def test_put(self, additionalproperties_endpoint): + async def test_extends_unknown_put(self, additionalproperties_endpoint): client = self.create_async_client(endpoint=additionalproperties_endpoint) response = await client.extends_unknown.put( body={"name": "str"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_is_float_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_is_float_operations.py index ac1ab1506d7..354263e1857 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_is_float_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_is_float_operations.py @@ -14,7 +14,7 @@ class TestAdditionalPropertiesIsFloatOperations(AdditionalPropertiesClientTestBase): @AdditionalPropertiesPreparer() @recorded_by_proxy - def test_get(self, additionalproperties_endpoint): + def test_is_float_get(self, additionalproperties_endpoint): client = self.create_client(endpoint=additionalproperties_endpoint) response = client.is_float.get() @@ -23,7 +23,7 @@ def test_get(self, additionalproperties_endpoint): @AdditionalPropertiesPreparer() @recorded_by_proxy - def test_put(self, additionalproperties_endpoint): + def test_is_float_put(self, additionalproperties_endpoint): client = self.create_client(endpoint=additionalproperties_endpoint) response = client.is_float.put( body={"id": 0.0}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_is_float_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_is_float_operations_async.py index 2bad0eaacb8..da7825acb80 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_is_float_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_is_float_operations_async.py @@ -15,7 +15,7 @@ class TestAdditionalPropertiesIsFloatOperationsAsync(AdditionalPropertiesClientTestBaseAsync): @AdditionalPropertiesPreparer() @recorded_by_proxy_async - async def test_get(self, additionalproperties_endpoint): + async def test_is_float_get(self, additionalproperties_endpoint): client = self.create_async_client(endpoint=additionalproperties_endpoint) response = await client.is_float.get() @@ -24,7 +24,7 @@ async def test_get(self, additionalproperties_endpoint): @AdditionalPropertiesPreparer() @recorded_by_proxy_async - async def test_put(self, additionalproperties_endpoint): + async def test_is_float_put(self, additionalproperties_endpoint): client = self.create_async_client(endpoint=additionalproperties_endpoint) response = await client.is_float.put( body={"id": 0.0}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_is_model_array_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_is_model_array_operations.py index 4e5d8ff12d4..bdb8bd90138 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_is_model_array_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_is_model_array_operations.py @@ -14,7 +14,7 @@ class TestAdditionalPropertiesIsModelArrayOperations(AdditionalPropertiesClientTestBase): @AdditionalPropertiesPreparer() @recorded_by_proxy - def test_get(self, additionalproperties_endpoint): + def test_is_model_array_get(self, additionalproperties_endpoint): client = self.create_client(endpoint=additionalproperties_endpoint) response = client.is_model_array.get() @@ -23,7 +23,7 @@ def test_get(self, additionalproperties_endpoint): @AdditionalPropertiesPreparer() @recorded_by_proxy - def test_put(self, additionalproperties_endpoint): + def test_is_model_array_put(self, additionalproperties_endpoint): client = self.create_client(endpoint=additionalproperties_endpoint) response = client.is_model_array.put( body={"knownProp": [{"state": "str"}]}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_is_model_array_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_is_model_array_operations_async.py index b6e342275b4..31593031a17 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_is_model_array_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_is_model_array_operations_async.py @@ -15,7 +15,7 @@ class TestAdditionalPropertiesIsModelArrayOperationsAsync(AdditionalPropertiesClientTestBaseAsync): @AdditionalPropertiesPreparer() @recorded_by_proxy_async - async def test_get(self, additionalproperties_endpoint): + async def test_is_model_array_get(self, additionalproperties_endpoint): client = self.create_async_client(endpoint=additionalproperties_endpoint) response = await client.is_model_array.get() @@ -24,7 +24,7 @@ async def test_get(self, additionalproperties_endpoint): @AdditionalPropertiesPreparer() @recorded_by_proxy_async - async def test_put(self, additionalproperties_endpoint): + async def test_is_model_array_put(self, additionalproperties_endpoint): client = self.create_async_client(endpoint=additionalproperties_endpoint) response = await client.is_model_array.put( body={"knownProp": [{"state": "str"}]}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_is_model_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_is_model_operations.py index 4aba5ef555f..5ccd7fddce3 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_is_model_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_is_model_operations.py @@ -14,7 +14,7 @@ class TestAdditionalPropertiesIsModelOperations(AdditionalPropertiesClientTestBase): @AdditionalPropertiesPreparer() @recorded_by_proxy - def test_get(self, additionalproperties_endpoint): + def test_is_model_get(self, additionalproperties_endpoint): client = self.create_client(endpoint=additionalproperties_endpoint) response = client.is_model.get() @@ -23,7 +23,7 @@ def test_get(self, additionalproperties_endpoint): @AdditionalPropertiesPreparer() @recorded_by_proxy - def test_put(self, additionalproperties_endpoint): + def test_is_model_put(self, additionalproperties_endpoint): client = self.create_client(endpoint=additionalproperties_endpoint) response = client.is_model.put( body={"knownProp": {"state": "str"}}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_is_model_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_is_model_operations_async.py index f2966da70c2..1606f5f21cc 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_is_model_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_is_model_operations_async.py @@ -15,7 +15,7 @@ class TestAdditionalPropertiesIsModelOperationsAsync(AdditionalPropertiesClientTestBaseAsync): @AdditionalPropertiesPreparer() @recorded_by_proxy_async - async def test_get(self, additionalproperties_endpoint): + async def test_is_model_get(self, additionalproperties_endpoint): client = self.create_async_client(endpoint=additionalproperties_endpoint) response = await client.is_model.get() @@ -24,7 +24,7 @@ async def test_get(self, additionalproperties_endpoint): @AdditionalPropertiesPreparer() @recorded_by_proxy_async - async def test_put(self, additionalproperties_endpoint): + async def test_is_model_put(self, additionalproperties_endpoint): client = self.create_async_client(endpoint=additionalproperties_endpoint) response = await client.is_model.put( body={"knownProp": {"state": "str"}}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_is_string_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_is_string_operations.py index 22144a13323..7fbd6658191 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_is_string_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_is_string_operations.py @@ -14,7 +14,7 @@ class TestAdditionalPropertiesIsStringOperations(AdditionalPropertiesClientTestBase): @AdditionalPropertiesPreparer() @recorded_by_proxy - def test_get(self, additionalproperties_endpoint): + def test_is_string_get(self, additionalproperties_endpoint): client = self.create_client(endpoint=additionalproperties_endpoint) response = client.is_string.get() @@ -23,7 +23,7 @@ def test_get(self, additionalproperties_endpoint): @AdditionalPropertiesPreparer() @recorded_by_proxy - def test_put(self, additionalproperties_endpoint): + def test_is_string_put(self, additionalproperties_endpoint): client = self.create_client(endpoint=additionalproperties_endpoint) response = client.is_string.put( body={"name": "str"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_is_string_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_is_string_operations_async.py index 19301208e2a..60854f96eb7 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_is_string_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_is_string_operations_async.py @@ -15,7 +15,7 @@ class TestAdditionalPropertiesIsStringOperationsAsync(AdditionalPropertiesClientTestBaseAsync): @AdditionalPropertiesPreparer() @recorded_by_proxy_async - async def test_get(self, additionalproperties_endpoint): + async def test_is_string_get(self, additionalproperties_endpoint): client = self.create_async_client(endpoint=additionalproperties_endpoint) response = await client.is_string.get() @@ -24,7 +24,7 @@ async def test_get(self, additionalproperties_endpoint): @AdditionalPropertiesPreparer() @recorded_by_proxy_async - async def test_put(self, additionalproperties_endpoint): + async def test_is_string_put(self, additionalproperties_endpoint): client = self.create_async_client(endpoint=additionalproperties_endpoint) response = await client.is_string.put( body={"name": "str"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_is_unknown_derived_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_is_unknown_derived_operations.py index 07ea22a25cd..b3798ae7950 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_is_unknown_derived_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_is_unknown_derived_operations.py @@ -14,7 +14,7 @@ class TestAdditionalPropertiesIsUnknownDerivedOperations(AdditionalPropertiesClientTestBase): @AdditionalPropertiesPreparer() @recorded_by_proxy - def test_get(self, additionalproperties_endpoint): + def test_is_unknown_derived_get(self, additionalproperties_endpoint): client = self.create_client(endpoint=additionalproperties_endpoint) response = client.is_unknown_derived.get() @@ -23,7 +23,7 @@ def test_get(self, additionalproperties_endpoint): @AdditionalPropertiesPreparer() @recorded_by_proxy - def test_put(self, additionalproperties_endpoint): + def test_is_unknown_derived_put(self, additionalproperties_endpoint): client = self.create_client(endpoint=additionalproperties_endpoint) response = client.is_unknown_derived.put( body={"index": 0, "name": "str", "age": 0.0}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_is_unknown_derived_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_is_unknown_derived_operations_async.py index fea39963acb..ff24780610d 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_is_unknown_derived_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_is_unknown_derived_operations_async.py @@ -15,7 +15,7 @@ class TestAdditionalPropertiesIsUnknownDerivedOperationsAsync(AdditionalPropertiesClientTestBaseAsync): @AdditionalPropertiesPreparer() @recorded_by_proxy_async - async def test_get(self, additionalproperties_endpoint): + async def test_is_unknown_derived_get(self, additionalproperties_endpoint): client = self.create_async_client(endpoint=additionalproperties_endpoint) response = await client.is_unknown_derived.get() @@ -24,7 +24,7 @@ async def test_get(self, additionalproperties_endpoint): @AdditionalPropertiesPreparer() @recorded_by_proxy_async - async def test_put(self, additionalproperties_endpoint): + async def test_is_unknown_derived_put(self, additionalproperties_endpoint): client = self.create_async_client(endpoint=additionalproperties_endpoint) response = await client.is_unknown_derived.put( body={"index": 0, "name": "str", "age": 0.0}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_is_unknown_discriminated_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_is_unknown_discriminated_operations.py index 60ad562cce8..6721020fb1a 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_is_unknown_discriminated_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_is_unknown_discriminated_operations.py @@ -14,7 +14,7 @@ class TestAdditionalPropertiesIsUnknownDiscriminatedOperations(AdditionalPropertiesClientTestBase): @AdditionalPropertiesPreparer() @recorded_by_proxy - def test_get(self, additionalproperties_endpoint): + def test_is_unknown_discriminated_get(self, additionalproperties_endpoint): client = self.create_client(endpoint=additionalproperties_endpoint) response = client.is_unknown_discriminated.get() @@ -23,7 +23,7 @@ def test_get(self, additionalproperties_endpoint): @AdditionalPropertiesPreparer() @recorded_by_proxy - def test_put(self, additionalproperties_endpoint): + def test_is_unknown_discriminated_put(self, additionalproperties_endpoint): client = self.create_client(endpoint=additionalproperties_endpoint) response = client.is_unknown_discriminated.put( body={"index": 0, "kind": "derived", "name": "str", "age": 0.0}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_is_unknown_discriminated_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_is_unknown_discriminated_operations_async.py index 6aa0e95abce..baabdf3a52e 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_is_unknown_discriminated_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_is_unknown_discriminated_operations_async.py @@ -15,7 +15,7 @@ class TestAdditionalPropertiesIsUnknownDiscriminatedOperationsAsync(AdditionalPropertiesClientTestBaseAsync): @AdditionalPropertiesPreparer() @recorded_by_proxy_async - async def test_get(self, additionalproperties_endpoint): + async def test_is_unknown_discriminated_get(self, additionalproperties_endpoint): client = self.create_async_client(endpoint=additionalproperties_endpoint) response = await client.is_unknown_discriminated.get() @@ -24,7 +24,7 @@ async def test_get(self, additionalproperties_endpoint): @AdditionalPropertiesPreparer() @recorded_by_proxy_async - async def test_put(self, additionalproperties_endpoint): + async def test_is_unknown_discriminated_put(self, additionalproperties_endpoint): client = self.create_async_client(endpoint=additionalproperties_endpoint) response = await client.is_unknown_discriminated.put( body={"index": 0, "kind": "derived", "name": "str", "age": 0.0}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_is_unknown_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_is_unknown_operations.py index 51d85ff4c02..8886d068ecd 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_is_unknown_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_is_unknown_operations.py @@ -14,7 +14,7 @@ class TestAdditionalPropertiesIsUnknownOperations(AdditionalPropertiesClientTestBase): @AdditionalPropertiesPreparer() @recorded_by_proxy - def test_get(self, additionalproperties_endpoint): + def test_is_unknown_get(self, additionalproperties_endpoint): client = self.create_client(endpoint=additionalproperties_endpoint) response = client.is_unknown.get() @@ -23,7 +23,7 @@ def test_get(self, additionalproperties_endpoint): @AdditionalPropertiesPreparer() @recorded_by_proxy - def test_put(self, additionalproperties_endpoint): + def test_is_unknown_put(self, additionalproperties_endpoint): client = self.create_client(endpoint=additionalproperties_endpoint) response = client.is_unknown.put( body={"name": "str"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_is_unknown_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_is_unknown_operations_async.py index df8793e3b86..a382ceef639 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_is_unknown_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_is_unknown_operations_async.py @@ -15,7 +15,7 @@ class TestAdditionalPropertiesIsUnknownOperationsAsync(AdditionalPropertiesClientTestBaseAsync): @AdditionalPropertiesPreparer() @recorded_by_proxy_async - async def test_get(self, additionalproperties_endpoint): + async def test_is_unknown_get(self, additionalproperties_endpoint): client = self.create_async_client(endpoint=additionalproperties_endpoint) response = await client.is_unknown.get() @@ -24,7 +24,7 @@ async def test_get(self, additionalproperties_endpoint): @AdditionalPropertiesPreparer() @recorded_by_proxy_async - async def test_put(self, additionalproperties_endpoint): + async def test_is_unknown_put(self, additionalproperties_endpoint): client = self.create_async_client(endpoint=additionalproperties_endpoint) response = await client.is_unknown.put( body={"name": "str"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_multiple_spread_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_multiple_spread_operations.py index 9e124d75f2f..05639d3daf0 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_multiple_spread_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_multiple_spread_operations.py @@ -14,7 +14,7 @@ class TestAdditionalPropertiesMultipleSpreadOperations(AdditionalPropertiesClientTestBase): @AdditionalPropertiesPreparer() @recorded_by_proxy - def test_get(self, additionalproperties_endpoint): + def test_multiple_spread_get(self, additionalproperties_endpoint): client = self.create_client(endpoint=additionalproperties_endpoint) response = client.multiple_spread.get() @@ -23,7 +23,7 @@ def test_get(self, additionalproperties_endpoint): @AdditionalPropertiesPreparer() @recorded_by_proxy - def test_put(self, additionalproperties_endpoint): + def test_multiple_spread_put(self, additionalproperties_endpoint): client = self.create_client(endpoint=additionalproperties_endpoint) response = client.multiple_spread.put( body={"flag": bool}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_multiple_spread_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_multiple_spread_operations_async.py index b5967b5da94..d252e42b2e6 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_multiple_spread_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_multiple_spread_operations_async.py @@ -15,7 +15,7 @@ class TestAdditionalPropertiesMultipleSpreadOperationsAsync(AdditionalPropertiesClientTestBaseAsync): @AdditionalPropertiesPreparer() @recorded_by_proxy_async - async def test_get(self, additionalproperties_endpoint): + async def test_multiple_spread_get(self, additionalproperties_endpoint): client = self.create_async_client(endpoint=additionalproperties_endpoint) response = await client.multiple_spread.get() @@ -24,7 +24,7 @@ async def test_get(self, additionalproperties_endpoint): @AdditionalPropertiesPreparer() @recorded_by_proxy_async - async def test_put(self, additionalproperties_endpoint): + async def test_multiple_spread_put(self, additionalproperties_endpoint): client = self.create_async_client(endpoint=additionalproperties_endpoint) response = await client.multiple_spread.put( body={"flag": bool}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_different_float_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_different_float_operations.py index f4cd4db941d..c49babb04e8 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_different_float_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_different_float_operations.py @@ -14,7 +14,7 @@ class TestAdditionalPropertiesSpreadDifferentFloatOperations(AdditionalPropertiesClientTestBase): @AdditionalPropertiesPreparer() @recorded_by_proxy - def test_get(self, additionalproperties_endpoint): + def test_spread_different_float_get(self, additionalproperties_endpoint): client = self.create_client(endpoint=additionalproperties_endpoint) response = client.spread_different_float.get() @@ -23,7 +23,7 @@ def test_get(self, additionalproperties_endpoint): @AdditionalPropertiesPreparer() @recorded_by_proxy - def test_put(self, additionalproperties_endpoint): + def test_spread_different_float_put(self, additionalproperties_endpoint): client = self.create_client(endpoint=additionalproperties_endpoint) response = client.spread_different_float.put( body={"name": "str"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_different_float_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_different_float_operations_async.py index 1645ac7b79c..a809a2f2a04 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_different_float_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_different_float_operations_async.py @@ -15,7 +15,7 @@ class TestAdditionalPropertiesSpreadDifferentFloatOperationsAsync(AdditionalPropertiesClientTestBaseAsync): @AdditionalPropertiesPreparer() @recorded_by_proxy_async - async def test_get(self, additionalproperties_endpoint): + async def test_spread_different_float_get(self, additionalproperties_endpoint): client = self.create_async_client(endpoint=additionalproperties_endpoint) response = await client.spread_different_float.get() @@ -24,7 +24,7 @@ async def test_get(self, additionalproperties_endpoint): @AdditionalPropertiesPreparer() @recorded_by_proxy_async - async def test_put(self, additionalproperties_endpoint): + async def test_spread_different_float_put(self, additionalproperties_endpoint): client = self.create_async_client(endpoint=additionalproperties_endpoint) response = await client.spread_different_float.put( body={"name": "str"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_different_model_array_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_different_model_array_operations.py index 22e4a3f1681..72f42e0aa6d 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_different_model_array_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_different_model_array_operations.py @@ -14,7 +14,7 @@ class TestAdditionalPropertiesSpreadDifferentModelArrayOperations(AdditionalPropertiesClientTestBase): @AdditionalPropertiesPreparer() @recorded_by_proxy - def test_get(self, additionalproperties_endpoint): + def test_spread_different_model_array_get(self, additionalproperties_endpoint): client = self.create_client(endpoint=additionalproperties_endpoint) response = client.spread_different_model_array.get() @@ -23,7 +23,7 @@ def test_get(self, additionalproperties_endpoint): @AdditionalPropertiesPreparer() @recorded_by_proxy - def test_put(self, additionalproperties_endpoint): + def test_spread_different_model_array_put(self, additionalproperties_endpoint): client = self.create_client(endpoint=additionalproperties_endpoint) response = client.spread_different_model_array.put( body={"knownProp": "str"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_different_model_array_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_different_model_array_operations_async.py index 615fa7a6346..87aa47bc9e0 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_different_model_array_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_different_model_array_operations_async.py @@ -15,7 +15,7 @@ class TestAdditionalPropertiesSpreadDifferentModelArrayOperationsAsync(AdditionalPropertiesClientTestBaseAsync): @AdditionalPropertiesPreparer() @recorded_by_proxy_async - async def test_get(self, additionalproperties_endpoint): + async def test_spread_different_model_array_get(self, additionalproperties_endpoint): client = self.create_async_client(endpoint=additionalproperties_endpoint) response = await client.spread_different_model_array.get() @@ -24,7 +24,7 @@ async def test_get(self, additionalproperties_endpoint): @AdditionalPropertiesPreparer() @recorded_by_proxy_async - async def test_put(self, additionalproperties_endpoint): + async def test_spread_different_model_array_put(self, additionalproperties_endpoint): client = self.create_async_client(endpoint=additionalproperties_endpoint) response = await client.spread_different_model_array.put( body={"knownProp": "str"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_different_model_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_different_model_operations.py index 2228121c97e..f98dbe3ac01 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_different_model_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_different_model_operations.py @@ -14,7 +14,7 @@ class TestAdditionalPropertiesSpreadDifferentModelOperations(AdditionalPropertiesClientTestBase): @AdditionalPropertiesPreparer() @recorded_by_proxy - def test_get(self, additionalproperties_endpoint): + def test_spread_different_model_get(self, additionalproperties_endpoint): client = self.create_client(endpoint=additionalproperties_endpoint) response = client.spread_different_model.get() @@ -23,7 +23,7 @@ def test_get(self, additionalproperties_endpoint): @AdditionalPropertiesPreparer() @recorded_by_proxy - def test_put(self, additionalproperties_endpoint): + def test_spread_different_model_put(self, additionalproperties_endpoint): client = self.create_client(endpoint=additionalproperties_endpoint) response = client.spread_different_model.put( body={"knownProp": "str"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_different_model_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_different_model_operations_async.py index 3d10979222c..bf9d2bed264 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_different_model_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_different_model_operations_async.py @@ -15,7 +15,7 @@ class TestAdditionalPropertiesSpreadDifferentModelOperationsAsync(AdditionalPropertiesClientTestBaseAsync): @AdditionalPropertiesPreparer() @recorded_by_proxy_async - async def test_get(self, additionalproperties_endpoint): + async def test_spread_different_model_get(self, additionalproperties_endpoint): client = self.create_async_client(endpoint=additionalproperties_endpoint) response = await client.spread_different_model.get() @@ -24,7 +24,7 @@ async def test_get(self, additionalproperties_endpoint): @AdditionalPropertiesPreparer() @recorded_by_proxy_async - async def test_put(self, additionalproperties_endpoint): + async def test_spread_different_model_put(self, additionalproperties_endpoint): client = self.create_async_client(endpoint=additionalproperties_endpoint) response = await client.spread_different_model.put( body={"knownProp": "str"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_different_string_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_different_string_operations.py index db379f50209..6dc582546a5 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_different_string_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_different_string_operations.py @@ -14,7 +14,7 @@ class TestAdditionalPropertiesSpreadDifferentStringOperations(AdditionalPropertiesClientTestBase): @AdditionalPropertiesPreparer() @recorded_by_proxy - def test_get(self, additionalproperties_endpoint): + def test_spread_different_string_get(self, additionalproperties_endpoint): client = self.create_client(endpoint=additionalproperties_endpoint) response = client.spread_different_string.get() @@ -23,7 +23,7 @@ def test_get(self, additionalproperties_endpoint): @AdditionalPropertiesPreparer() @recorded_by_proxy - def test_put(self, additionalproperties_endpoint): + def test_spread_different_string_put(self, additionalproperties_endpoint): client = self.create_client(endpoint=additionalproperties_endpoint) response = client.spread_different_string.put( body={"id": 0.0}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_different_string_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_different_string_operations_async.py index c0ff54f14dd..65018748418 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_different_string_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_different_string_operations_async.py @@ -15,7 +15,7 @@ class TestAdditionalPropertiesSpreadDifferentStringOperationsAsync(AdditionalPropertiesClientTestBaseAsync): @AdditionalPropertiesPreparer() @recorded_by_proxy_async - async def test_get(self, additionalproperties_endpoint): + async def test_spread_different_string_get(self, additionalproperties_endpoint): client = self.create_async_client(endpoint=additionalproperties_endpoint) response = await client.spread_different_string.get() @@ -24,7 +24,7 @@ async def test_get(self, additionalproperties_endpoint): @AdditionalPropertiesPreparer() @recorded_by_proxy_async - async def test_put(self, additionalproperties_endpoint): + async def test_spread_different_string_put(self, additionalproperties_endpoint): client = self.create_async_client(endpoint=additionalproperties_endpoint) response = await client.spread_different_string.put( body={"id": 0.0}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_float_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_float_operations.py index a2bace80696..6061341f6b0 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_float_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_float_operations.py @@ -14,7 +14,7 @@ class TestAdditionalPropertiesSpreadFloatOperations(AdditionalPropertiesClientTestBase): @AdditionalPropertiesPreparer() @recorded_by_proxy - def test_get(self, additionalproperties_endpoint): + def test_spread_float_get(self, additionalproperties_endpoint): client = self.create_client(endpoint=additionalproperties_endpoint) response = client.spread_float.get() @@ -23,7 +23,7 @@ def test_get(self, additionalproperties_endpoint): @AdditionalPropertiesPreparer() @recorded_by_proxy - def test_put(self, additionalproperties_endpoint): + def test_spread_float_put(self, additionalproperties_endpoint): client = self.create_client(endpoint=additionalproperties_endpoint) response = client.spread_float.put( body={"id": 0.0}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_float_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_float_operations_async.py index d56a66ba0b2..429930f2719 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_float_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_float_operations_async.py @@ -15,7 +15,7 @@ class TestAdditionalPropertiesSpreadFloatOperationsAsync(AdditionalPropertiesClientTestBaseAsync): @AdditionalPropertiesPreparer() @recorded_by_proxy_async - async def test_get(self, additionalproperties_endpoint): + async def test_spread_float_get(self, additionalproperties_endpoint): client = self.create_async_client(endpoint=additionalproperties_endpoint) response = await client.spread_float.get() @@ -24,7 +24,7 @@ async def test_get(self, additionalproperties_endpoint): @AdditionalPropertiesPreparer() @recorded_by_proxy_async - async def test_put(self, additionalproperties_endpoint): + async def test_spread_float_put(self, additionalproperties_endpoint): client = self.create_async_client(endpoint=additionalproperties_endpoint) response = await client.spread_float.put( body={"id": 0.0}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_model_array_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_model_array_operations.py index 1b8df4764b2..ba829536ceb 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_model_array_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_model_array_operations.py @@ -14,7 +14,7 @@ class TestAdditionalPropertiesSpreadModelArrayOperations(AdditionalPropertiesClientTestBase): @AdditionalPropertiesPreparer() @recorded_by_proxy - def test_get(self, additionalproperties_endpoint): + def test_spread_model_array_get(self, additionalproperties_endpoint): client = self.create_client(endpoint=additionalproperties_endpoint) response = client.spread_model_array.get() @@ -23,7 +23,7 @@ def test_get(self, additionalproperties_endpoint): @AdditionalPropertiesPreparer() @recorded_by_proxy - def test_put(self, additionalproperties_endpoint): + def test_spread_model_array_put(self, additionalproperties_endpoint): client = self.create_client(endpoint=additionalproperties_endpoint) response = client.spread_model_array.put( body={"knownProp": [{"state": "str"}]}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_model_array_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_model_array_operations_async.py index 501585bb796..2647755f4dd 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_model_array_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_model_array_operations_async.py @@ -15,7 +15,7 @@ class TestAdditionalPropertiesSpreadModelArrayOperationsAsync(AdditionalPropertiesClientTestBaseAsync): @AdditionalPropertiesPreparer() @recorded_by_proxy_async - async def test_get(self, additionalproperties_endpoint): + async def test_spread_model_array_get(self, additionalproperties_endpoint): client = self.create_async_client(endpoint=additionalproperties_endpoint) response = await client.spread_model_array.get() @@ -24,7 +24,7 @@ async def test_get(self, additionalproperties_endpoint): @AdditionalPropertiesPreparer() @recorded_by_proxy_async - async def test_put(self, additionalproperties_endpoint): + async def test_spread_model_array_put(self, additionalproperties_endpoint): client = self.create_async_client(endpoint=additionalproperties_endpoint) response = await client.spread_model_array.put( body={"knownProp": [{"state": "str"}]}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_model_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_model_operations.py index e1af3271957..9fe7fb6e2cc 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_model_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_model_operations.py @@ -14,7 +14,7 @@ class TestAdditionalPropertiesSpreadModelOperations(AdditionalPropertiesClientTestBase): @AdditionalPropertiesPreparer() @recorded_by_proxy - def test_get(self, additionalproperties_endpoint): + def test_spread_model_get(self, additionalproperties_endpoint): client = self.create_client(endpoint=additionalproperties_endpoint) response = client.spread_model.get() @@ -23,7 +23,7 @@ def test_get(self, additionalproperties_endpoint): @AdditionalPropertiesPreparer() @recorded_by_proxy - def test_put(self, additionalproperties_endpoint): + def test_spread_model_put(self, additionalproperties_endpoint): client = self.create_client(endpoint=additionalproperties_endpoint) response = client.spread_model.put( body={"knownProp": {"state": "str"}}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_model_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_model_operations_async.py index 740d0f35926..d1987ed0a6d 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_model_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_model_operations_async.py @@ -15,7 +15,7 @@ class TestAdditionalPropertiesSpreadModelOperationsAsync(AdditionalPropertiesClientTestBaseAsync): @AdditionalPropertiesPreparer() @recorded_by_proxy_async - async def test_get(self, additionalproperties_endpoint): + async def test_spread_model_get(self, additionalproperties_endpoint): client = self.create_async_client(endpoint=additionalproperties_endpoint) response = await client.spread_model.get() @@ -24,7 +24,7 @@ async def test_get(self, additionalproperties_endpoint): @AdditionalPropertiesPreparer() @recorded_by_proxy_async - async def test_put(self, additionalproperties_endpoint): + async def test_spread_model_put(self, additionalproperties_endpoint): client = self.create_async_client(endpoint=additionalproperties_endpoint) response = await client.spread_model.put( body={"knownProp": {"state": "str"}}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_record_discriminated_union_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_record_discriminated_union_operations.py index c214c376733..d783fba2a7e 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_record_discriminated_union_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_record_discriminated_union_operations.py @@ -14,7 +14,7 @@ class TestAdditionalPropertiesSpreadRecordDiscriminatedUnionOperations(AdditionalPropertiesClientTestBase): @AdditionalPropertiesPreparer() @recorded_by_proxy - def test_get(self, additionalproperties_endpoint): + def test_spread_record_discriminated_union_get(self, additionalproperties_endpoint): client = self.create_client(endpoint=additionalproperties_endpoint) response = client.spread_record_discriminated_union.get() @@ -23,7 +23,7 @@ def test_get(self, additionalproperties_endpoint): @AdditionalPropertiesPreparer() @recorded_by_proxy - def test_put(self, additionalproperties_endpoint): + def test_spread_record_discriminated_union_put(self, additionalproperties_endpoint): client = self.create_client(endpoint=additionalproperties_endpoint) response = client.spread_record_discriminated_union.put( body={"name": "str"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_record_discriminated_union_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_record_discriminated_union_operations_async.py index 9c9a7deb7a5..f9afa893275 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_record_discriminated_union_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_record_discriminated_union_operations_async.py @@ -15,7 +15,7 @@ class TestAdditionalPropertiesSpreadRecordDiscriminatedUnionOperationsAsync(AdditionalPropertiesClientTestBaseAsync): @AdditionalPropertiesPreparer() @recorded_by_proxy_async - async def test_get(self, additionalproperties_endpoint): + async def test_spread_record_discriminated_union_get(self, additionalproperties_endpoint): client = self.create_async_client(endpoint=additionalproperties_endpoint) response = await client.spread_record_discriminated_union.get() @@ -24,7 +24,7 @@ async def test_get(self, additionalproperties_endpoint): @AdditionalPropertiesPreparer() @recorded_by_proxy_async - async def test_put(self, additionalproperties_endpoint): + async def test_spread_record_discriminated_union_put(self, additionalproperties_endpoint): client = self.create_async_client(endpoint=additionalproperties_endpoint) response = await client.spread_record_discriminated_union.put( body={"name": "str"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_record_non_discriminated_union2_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_record_non_discriminated_union2_operations.py index 2daf4d2607b..1e2055dfb52 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_record_non_discriminated_union2_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_record_non_discriminated_union2_operations.py @@ -14,7 +14,7 @@ class TestAdditionalPropertiesSpreadRecordNonDiscriminatedUnion2Operations(AdditionalPropertiesClientTestBase): @AdditionalPropertiesPreparer() @recorded_by_proxy - def test_get(self, additionalproperties_endpoint): + def test_spread_record_non_discriminated_union2_get(self, additionalproperties_endpoint): client = self.create_client(endpoint=additionalproperties_endpoint) response = client.spread_record_non_discriminated_union2.get() @@ -23,7 +23,7 @@ def test_get(self, additionalproperties_endpoint): @AdditionalPropertiesPreparer() @recorded_by_proxy - def test_put(self, additionalproperties_endpoint): + def test_spread_record_non_discriminated_union2_put(self, additionalproperties_endpoint): client = self.create_client(endpoint=additionalproperties_endpoint) response = client.spread_record_non_discriminated_union2.put( body={"name": "str"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_record_non_discriminated_union2_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_record_non_discriminated_union2_operations_async.py index efc641d13b1..b4fc9526888 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_record_non_discriminated_union2_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_record_non_discriminated_union2_operations_async.py @@ -17,7 +17,7 @@ class TestAdditionalPropertiesSpreadRecordNonDiscriminatedUnion2OperationsAsync( ): @AdditionalPropertiesPreparer() @recorded_by_proxy_async - async def test_get(self, additionalproperties_endpoint): + async def test_spread_record_non_discriminated_union2_get(self, additionalproperties_endpoint): client = self.create_async_client(endpoint=additionalproperties_endpoint) response = await client.spread_record_non_discriminated_union2.get() @@ -26,7 +26,7 @@ async def test_get(self, additionalproperties_endpoint): @AdditionalPropertiesPreparer() @recorded_by_proxy_async - async def test_put(self, additionalproperties_endpoint): + async def test_spread_record_non_discriminated_union2_put(self, additionalproperties_endpoint): client = self.create_async_client(endpoint=additionalproperties_endpoint) response = await client.spread_record_non_discriminated_union2.put( body={"name": "str"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_record_non_discriminated_union3_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_record_non_discriminated_union3_operations.py index bba6142ae4b..d80b30b4424 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_record_non_discriminated_union3_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_record_non_discriminated_union3_operations.py @@ -14,7 +14,7 @@ class TestAdditionalPropertiesSpreadRecordNonDiscriminatedUnion3Operations(AdditionalPropertiesClientTestBase): @AdditionalPropertiesPreparer() @recorded_by_proxy - def test_get(self, additionalproperties_endpoint): + def test_spread_record_non_discriminated_union3_get(self, additionalproperties_endpoint): client = self.create_client(endpoint=additionalproperties_endpoint) response = client.spread_record_non_discriminated_union3.get() @@ -23,7 +23,7 @@ def test_get(self, additionalproperties_endpoint): @AdditionalPropertiesPreparer() @recorded_by_proxy - def test_put(self, additionalproperties_endpoint): + def test_spread_record_non_discriminated_union3_put(self, additionalproperties_endpoint): client = self.create_client(endpoint=additionalproperties_endpoint) response = client.spread_record_non_discriminated_union3.put( body={"name": "str"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_record_non_discriminated_union3_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_record_non_discriminated_union3_operations_async.py index 028eee6a594..9b6f4cf260e 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_record_non_discriminated_union3_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_record_non_discriminated_union3_operations_async.py @@ -17,7 +17,7 @@ class TestAdditionalPropertiesSpreadRecordNonDiscriminatedUnion3OperationsAsync( ): @AdditionalPropertiesPreparer() @recorded_by_proxy_async - async def test_get(self, additionalproperties_endpoint): + async def test_spread_record_non_discriminated_union3_get(self, additionalproperties_endpoint): client = self.create_async_client(endpoint=additionalproperties_endpoint) response = await client.spread_record_non_discriminated_union3.get() @@ -26,7 +26,7 @@ async def test_get(self, additionalproperties_endpoint): @AdditionalPropertiesPreparer() @recorded_by_proxy_async - async def test_put(self, additionalproperties_endpoint): + async def test_spread_record_non_discriminated_union3_put(self, additionalproperties_endpoint): client = self.create_async_client(endpoint=additionalproperties_endpoint) response = await client.spread_record_non_discriminated_union3.put( body={"name": "str"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_record_non_discriminated_union_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_record_non_discriminated_union_operations.py index c0f922ed2bd..fc4e613ba15 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_record_non_discriminated_union_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_record_non_discriminated_union_operations.py @@ -14,7 +14,7 @@ class TestAdditionalPropertiesSpreadRecordNonDiscriminatedUnionOperations(AdditionalPropertiesClientTestBase): @AdditionalPropertiesPreparer() @recorded_by_proxy - def test_get(self, additionalproperties_endpoint): + def test_spread_record_non_discriminated_union_get(self, additionalproperties_endpoint): client = self.create_client(endpoint=additionalproperties_endpoint) response = client.spread_record_non_discriminated_union.get() @@ -23,7 +23,7 @@ def test_get(self, additionalproperties_endpoint): @AdditionalPropertiesPreparer() @recorded_by_proxy - def test_put(self, additionalproperties_endpoint): + def test_spread_record_non_discriminated_union_put(self, additionalproperties_endpoint): client = self.create_client(endpoint=additionalproperties_endpoint) response = client.spread_record_non_discriminated_union.put( body={"name": "str"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_record_non_discriminated_union_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_record_non_discriminated_union_operations_async.py index d113f26b6dc..af876dc59cc 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_record_non_discriminated_union_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_record_non_discriminated_union_operations_async.py @@ -15,7 +15,7 @@ class TestAdditionalPropertiesSpreadRecordNonDiscriminatedUnionOperationsAsync(AdditionalPropertiesClientTestBaseAsync): @AdditionalPropertiesPreparer() @recorded_by_proxy_async - async def test_get(self, additionalproperties_endpoint): + async def test_spread_record_non_discriminated_union_get(self, additionalproperties_endpoint): client = self.create_async_client(endpoint=additionalproperties_endpoint) response = await client.spread_record_non_discriminated_union.get() @@ -24,7 +24,7 @@ async def test_get(self, additionalproperties_endpoint): @AdditionalPropertiesPreparer() @recorded_by_proxy_async - async def test_put(self, additionalproperties_endpoint): + async def test_spread_record_non_discriminated_union_put(self, additionalproperties_endpoint): client = self.create_async_client(endpoint=additionalproperties_endpoint) response = await client.spread_record_non_discriminated_union.put( body={"name": "str"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_record_union_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_record_union_operations.py index 97d7abfa515..a78a589899d 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_record_union_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_record_union_operations.py @@ -14,7 +14,7 @@ class TestAdditionalPropertiesSpreadRecordUnionOperations(AdditionalPropertiesClientTestBase): @AdditionalPropertiesPreparer() @recorded_by_proxy - def test_get(self, additionalproperties_endpoint): + def test_spread_record_union_get(self, additionalproperties_endpoint): client = self.create_client(endpoint=additionalproperties_endpoint) response = client.spread_record_union.get() @@ -23,7 +23,7 @@ def test_get(self, additionalproperties_endpoint): @AdditionalPropertiesPreparer() @recorded_by_proxy - def test_put(self, additionalproperties_endpoint): + def test_spread_record_union_put(self, additionalproperties_endpoint): client = self.create_client(endpoint=additionalproperties_endpoint) response = client.spread_record_union.put( body={"flag": bool}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_record_union_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_record_union_operations_async.py index a796c1470ef..6738840018d 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_record_union_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_record_union_operations_async.py @@ -15,7 +15,7 @@ class TestAdditionalPropertiesSpreadRecordUnionOperationsAsync(AdditionalPropertiesClientTestBaseAsync): @AdditionalPropertiesPreparer() @recorded_by_proxy_async - async def test_get(self, additionalproperties_endpoint): + async def test_spread_record_union_get(self, additionalproperties_endpoint): client = self.create_async_client(endpoint=additionalproperties_endpoint) response = await client.spread_record_union.get() @@ -24,7 +24,7 @@ async def test_get(self, additionalproperties_endpoint): @AdditionalPropertiesPreparer() @recorded_by_proxy_async - async def test_put(self, additionalproperties_endpoint): + async def test_spread_record_union_put(self, additionalproperties_endpoint): client = self.create_async_client(endpoint=additionalproperties_endpoint) response = await client.spread_record_union.put( body={"flag": bool}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_string_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_string_operations.py index cf92bb40a3d..b01e760174d 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_string_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_string_operations.py @@ -14,7 +14,7 @@ class TestAdditionalPropertiesSpreadStringOperations(AdditionalPropertiesClientTestBase): @AdditionalPropertiesPreparer() @recorded_by_proxy - def test_get(self, additionalproperties_endpoint): + def test_spread_string_get(self, additionalproperties_endpoint): client = self.create_client(endpoint=additionalproperties_endpoint) response = client.spread_string.get() @@ -23,7 +23,7 @@ def test_get(self, additionalproperties_endpoint): @AdditionalPropertiesPreparer() @recorded_by_proxy - def test_put(self, additionalproperties_endpoint): + def test_spread_string_put(self, additionalproperties_endpoint): client = self.create_client(endpoint=additionalproperties_endpoint) response = client.spread_string.put( body={"name": "str"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_string_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_string_operations_async.py index 0604497ec7a..6647bf7b020 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_string_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-additionalproperties/generated_tests/test_additional_properties_spread_string_operations_async.py @@ -15,7 +15,7 @@ class TestAdditionalPropertiesSpreadStringOperationsAsync(AdditionalPropertiesClientTestBaseAsync): @AdditionalPropertiesPreparer() @recorded_by_proxy_async - async def test_get(self, additionalproperties_endpoint): + async def test_spread_string_get(self, additionalproperties_endpoint): client = self.create_async_client(endpoint=additionalproperties_endpoint) response = await client.spread_string.get() @@ -24,7 +24,7 @@ async def test_get(self, additionalproperties_endpoint): @AdditionalPropertiesPreparer() @recorded_by_proxy_async - async def test_put(self, additionalproperties_endpoint): + async def test_spread_string_put(self, additionalproperties_endpoint): client = self.create_async_client(endpoint=additionalproperties_endpoint) response = await client.spread_string.put( body={"name": "str"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-nullable/generated_tests/test_nullable_bytes_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-nullable/generated_tests/test_nullable_bytes_operations.py index 270eddd7402..b6cb74e9109 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-nullable/generated_tests/test_nullable_bytes_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-nullable/generated_tests/test_nullable_bytes_operations.py @@ -14,7 +14,7 @@ class TestNullableBytesOperations(NullableClientTestBase): @NullablePreparer() @recorded_by_proxy - def test_get_non_null(self, nullable_endpoint): + def test_bytes_get_non_null(self, nullable_endpoint): client = self.create_client(endpoint=nullable_endpoint) response = client.bytes.get_non_null() @@ -23,7 +23,7 @@ def test_get_non_null(self, nullable_endpoint): @NullablePreparer() @recorded_by_proxy - def test_get_null(self, nullable_endpoint): + def test_bytes_get_null(self, nullable_endpoint): client = self.create_client(endpoint=nullable_endpoint) response = client.bytes.get_null() @@ -32,7 +32,7 @@ def test_get_null(self, nullable_endpoint): @NullablePreparer() @recorded_by_proxy - def test_patch_non_null(self, nullable_endpoint): + def test_bytes_patch_non_null(self, nullable_endpoint): client = self.create_client(endpoint=nullable_endpoint) response = client.bytes.patch_non_null( body={"nullableProperty": bytes("bytes", encoding="utf-8"), "requiredProperty": "str"}, @@ -43,7 +43,7 @@ def test_patch_non_null(self, nullable_endpoint): @NullablePreparer() @recorded_by_proxy - def test_patch_null(self, nullable_endpoint): + def test_bytes_patch_null(self, nullable_endpoint): client = self.create_client(endpoint=nullable_endpoint) response = client.bytes.patch_null( body={"nullableProperty": bytes("bytes", encoding="utf-8"), "requiredProperty": "str"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-nullable/generated_tests/test_nullable_bytes_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-property-nullable/generated_tests/test_nullable_bytes_operations_async.py index 99b9fe80233..792c936c76e 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-nullable/generated_tests/test_nullable_bytes_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-nullable/generated_tests/test_nullable_bytes_operations_async.py @@ -15,7 +15,7 @@ class TestNullableBytesOperationsAsync(NullableClientTestBaseAsync): @NullablePreparer() @recorded_by_proxy_async - async def test_get_non_null(self, nullable_endpoint): + async def test_bytes_get_non_null(self, nullable_endpoint): client = self.create_async_client(endpoint=nullable_endpoint) response = await client.bytes.get_non_null() @@ -24,7 +24,7 @@ async def test_get_non_null(self, nullable_endpoint): @NullablePreparer() @recorded_by_proxy_async - async def test_get_null(self, nullable_endpoint): + async def test_bytes_get_null(self, nullable_endpoint): client = self.create_async_client(endpoint=nullable_endpoint) response = await client.bytes.get_null() @@ -33,7 +33,7 @@ async def test_get_null(self, nullable_endpoint): @NullablePreparer() @recorded_by_proxy_async - async def test_patch_non_null(self, nullable_endpoint): + async def test_bytes_patch_non_null(self, nullable_endpoint): client = self.create_async_client(endpoint=nullable_endpoint) response = await client.bytes.patch_non_null( body={"nullableProperty": bytes("bytes", encoding="utf-8"), "requiredProperty": "str"}, @@ -44,7 +44,7 @@ async def test_patch_non_null(self, nullable_endpoint): @NullablePreparer() @recorded_by_proxy_async - async def test_patch_null(self, nullable_endpoint): + async def test_bytes_patch_null(self, nullable_endpoint): client = self.create_async_client(endpoint=nullable_endpoint) response = await client.bytes.patch_null( body={"nullableProperty": bytes("bytes", encoding="utf-8"), "requiredProperty": "str"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-nullable/generated_tests/test_nullable_collections_byte_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-nullable/generated_tests/test_nullable_collections_byte_operations.py index eaac9bc612f..ab22c0a94d7 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-nullable/generated_tests/test_nullable_collections_byte_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-nullable/generated_tests/test_nullable_collections_byte_operations.py @@ -14,7 +14,7 @@ class TestNullableCollectionsByteOperations(NullableClientTestBase): @NullablePreparer() @recorded_by_proxy - def test_get_non_null(self, nullable_endpoint): + def test_collections_byte_get_non_null(self, nullable_endpoint): client = self.create_client(endpoint=nullable_endpoint) response = client.collections_byte.get_non_null() @@ -23,7 +23,7 @@ def test_get_non_null(self, nullable_endpoint): @NullablePreparer() @recorded_by_proxy - def test_get_null(self, nullable_endpoint): + def test_collections_byte_get_null(self, nullable_endpoint): client = self.create_client(endpoint=nullable_endpoint) response = client.collections_byte.get_null() @@ -32,7 +32,7 @@ def test_get_null(self, nullable_endpoint): @NullablePreparer() @recorded_by_proxy - def test_patch_non_null(self, nullable_endpoint): + def test_collections_byte_patch_non_null(self, nullable_endpoint): client = self.create_client(endpoint=nullable_endpoint) response = client.collections_byte.patch_non_null( body={"nullableProperty": [bytes("bytes", encoding="utf-8")], "requiredProperty": "str"}, @@ -43,7 +43,7 @@ def test_patch_non_null(self, nullable_endpoint): @NullablePreparer() @recorded_by_proxy - def test_patch_null(self, nullable_endpoint): + def test_collections_byte_patch_null(self, nullable_endpoint): client = self.create_client(endpoint=nullable_endpoint) response = client.collections_byte.patch_null( body={"nullableProperty": [bytes("bytes", encoding="utf-8")], "requiredProperty": "str"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-nullable/generated_tests/test_nullable_collections_byte_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-property-nullable/generated_tests/test_nullable_collections_byte_operations_async.py index 9503c509cda..b970b004499 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-nullable/generated_tests/test_nullable_collections_byte_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-nullable/generated_tests/test_nullable_collections_byte_operations_async.py @@ -15,7 +15,7 @@ class TestNullableCollectionsByteOperationsAsync(NullableClientTestBaseAsync): @NullablePreparer() @recorded_by_proxy_async - async def test_get_non_null(self, nullable_endpoint): + async def test_collections_byte_get_non_null(self, nullable_endpoint): client = self.create_async_client(endpoint=nullable_endpoint) response = await client.collections_byte.get_non_null() @@ -24,7 +24,7 @@ async def test_get_non_null(self, nullable_endpoint): @NullablePreparer() @recorded_by_proxy_async - async def test_get_null(self, nullable_endpoint): + async def test_collections_byte_get_null(self, nullable_endpoint): client = self.create_async_client(endpoint=nullable_endpoint) response = await client.collections_byte.get_null() @@ -33,7 +33,7 @@ async def test_get_null(self, nullable_endpoint): @NullablePreparer() @recorded_by_proxy_async - async def test_patch_non_null(self, nullable_endpoint): + async def test_collections_byte_patch_non_null(self, nullable_endpoint): client = self.create_async_client(endpoint=nullable_endpoint) response = await client.collections_byte.patch_non_null( body={"nullableProperty": [bytes("bytes", encoding="utf-8")], "requiredProperty": "str"}, @@ -44,7 +44,7 @@ async def test_patch_non_null(self, nullable_endpoint): @NullablePreparer() @recorded_by_proxy_async - async def test_patch_null(self, nullable_endpoint): + async def test_collections_byte_patch_null(self, nullable_endpoint): client = self.create_async_client(endpoint=nullable_endpoint) response = await client.collections_byte.patch_null( body={"nullableProperty": [bytes("bytes", encoding="utf-8")], "requiredProperty": "str"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-nullable/generated_tests/test_nullable_collections_model_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-nullable/generated_tests/test_nullable_collections_model_operations.py index 27c360dafa5..36ead8cceca 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-nullable/generated_tests/test_nullable_collections_model_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-nullable/generated_tests/test_nullable_collections_model_operations.py @@ -14,7 +14,7 @@ class TestNullableCollectionsModelOperations(NullableClientTestBase): @NullablePreparer() @recorded_by_proxy - def test_get_non_null(self, nullable_endpoint): + def test_collections_model_get_non_null(self, nullable_endpoint): client = self.create_client(endpoint=nullable_endpoint) response = client.collections_model.get_non_null() @@ -23,7 +23,7 @@ def test_get_non_null(self, nullable_endpoint): @NullablePreparer() @recorded_by_proxy - def test_get_null(self, nullable_endpoint): + def test_collections_model_get_null(self, nullable_endpoint): client = self.create_client(endpoint=nullable_endpoint) response = client.collections_model.get_null() @@ -32,7 +32,7 @@ def test_get_null(self, nullable_endpoint): @NullablePreparer() @recorded_by_proxy - def test_patch_non_null(self, nullable_endpoint): + def test_collections_model_patch_non_null(self, nullable_endpoint): client = self.create_client(endpoint=nullable_endpoint) response = client.collections_model.patch_non_null( body={"nullableProperty": [{"property": "str"}], "requiredProperty": "str"}, @@ -43,7 +43,7 @@ def test_patch_non_null(self, nullable_endpoint): @NullablePreparer() @recorded_by_proxy - def test_patch_null(self, nullable_endpoint): + def test_collections_model_patch_null(self, nullable_endpoint): client = self.create_client(endpoint=nullable_endpoint) response = client.collections_model.patch_null( body={"nullableProperty": [{"property": "str"}], "requiredProperty": "str"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-nullable/generated_tests/test_nullable_collections_model_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-property-nullable/generated_tests/test_nullable_collections_model_operations_async.py index e726dda3a2c..dd0a92fa140 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-nullable/generated_tests/test_nullable_collections_model_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-nullable/generated_tests/test_nullable_collections_model_operations_async.py @@ -15,7 +15,7 @@ class TestNullableCollectionsModelOperationsAsync(NullableClientTestBaseAsync): @NullablePreparer() @recorded_by_proxy_async - async def test_get_non_null(self, nullable_endpoint): + async def test_collections_model_get_non_null(self, nullable_endpoint): client = self.create_async_client(endpoint=nullable_endpoint) response = await client.collections_model.get_non_null() @@ -24,7 +24,7 @@ async def test_get_non_null(self, nullable_endpoint): @NullablePreparer() @recorded_by_proxy_async - async def test_get_null(self, nullable_endpoint): + async def test_collections_model_get_null(self, nullable_endpoint): client = self.create_async_client(endpoint=nullable_endpoint) response = await client.collections_model.get_null() @@ -33,7 +33,7 @@ async def test_get_null(self, nullable_endpoint): @NullablePreparer() @recorded_by_proxy_async - async def test_patch_non_null(self, nullable_endpoint): + async def test_collections_model_patch_non_null(self, nullable_endpoint): client = self.create_async_client(endpoint=nullable_endpoint) response = await client.collections_model.patch_non_null( body={"nullableProperty": [{"property": "str"}], "requiredProperty": "str"}, @@ -44,7 +44,7 @@ async def test_patch_non_null(self, nullable_endpoint): @NullablePreparer() @recorded_by_proxy_async - async def test_patch_null(self, nullable_endpoint): + async def test_collections_model_patch_null(self, nullable_endpoint): client = self.create_async_client(endpoint=nullable_endpoint) response = await client.collections_model.patch_null( body={"nullableProperty": [{"property": "str"}], "requiredProperty": "str"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-nullable/generated_tests/test_nullable_collections_string_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-nullable/generated_tests/test_nullable_collections_string_operations.py index b3f30007592..ec73d86cce2 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-nullable/generated_tests/test_nullable_collections_string_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-nullable/generated_tests/test_nullable_collections_string_operations.py @@ -14,7 +14,7 @@ class TestNullableCollectionsStringOperations(NullableClientTestBase): @NullablePreparer() @recorded_by_proxy - def test_get_non_null(self, nullable_endpoint): + def test_collections_string_get_non_null(self, nullable_endpoint): client = self.create_client(endpoint=nullable_endpoint) response = client.collections_string.get_non_null() @@ -23,7 +23,7 @@ def test_get_non_null(self, nullable_endpoint): @NullablePreparer() @recorded_by_proxy - def test_get_null(self, nullable_endpoint): + def test_collections_string_get_null(self, nullable_endpoint): client = self.create_client(endpoint=nullable_endpoint) response = client.collections_string.get_null() @@ -32,7 +32,7 @@ def test_get_null(self, nullable_endpoint): @NullablePreparer() @recorded_by_proxy - def test_patch_non_null(self, nullable_endpoint): + def test_collections_string_patch_non_null(self, nullable_endpoint): client = self.create_client(endpoint=nullable_endpoint) response = client.collections_string.patch_non_null( body={"nullableProperty": ["str"], "requiredProperty": "str"}, @@ -43,7 +43,7 @@ def test_patch_non_null(self, nullable_endpoint): @NullablePreparer() @recorded_by_proxy - def test_patch_null(self, nullable_endpoint): + def test_collections_string_patch_null(self, nullable_endpoint): client = self.create_client(endpoint=nullable_endpoint) response = client.collections_string.patch_null( body={"nullableProperty": ["str"], "requiredProperty": "str"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-nullable/generated_tests/test_nullable_collections_string_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-property-nullable/generated_tests/test_nullable_collections_string_operations_async.py index 342f5e7ba33..f8e87b572b6 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-nullable/generated_tests/test_nullable_collections_string_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-nullable/generated_tests/test_nullable_collections_string_operations_async.py @@ -15,7 +15,7 @@ class TestNullableCollectionsStringOperationsAsync(NullableClientTestBaseAsync): @NullablePreparer() @recorded_by_proxy_async - async def test_get_non_null(self, nullable_endpoint): + async def test_collections_string_get_non_null(self, nullable_endpoint): client = self.create_async_client(endpoint=nullable_endpoint) response = await client.collections_string.get_non_null() @@ -24,7 +24,7 @@ async def test_get_non_null(self, nullable_endpoint): @NullablePreparer() @recorded_by_proxy_async - async def test_get_null(self, nullable_endpoint): + async def test_collections_string_get_null(self, nullable_endpoint): client = self.create_async_client(endpoint=nullable_endpoint) response = await client.collections_string.get_null() @@ -33,7 +33,7 @@ async def test_get_null(self, nullable_endpoint): @NullablePreparer() @recorded_by_proxy_async - async def test_patch_non_null(self, nullable_endpoint): + async def test_collections_string_patch_non_null(self, nullable_endpoint): client = self.create_async_client(endpoint=nullable_endpoint) response = await client.collections_string.patch_non_null( body={"nullableProperty": ["str"], "requiredProperty": "str"}, @@ -44,7 +44,7 @@ async def test_patch_non_null(self, nullable_endpoint): @NullablePreparer() @recorded_by_proxy_async - async def test_patch_null(self, nullable_endpoint): + async def test_collections_string_patch_null(self, nullable_endpoint): client = self.create_async_client(endpoint=nullable_endpoint) response = await client.collections_string.patch_null( body={"nullableProperty": ["str"], "requiredProperty": "str"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-nullable/generated_tests/test_nullable_datetime_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-nullable/generated_tests/test_nullable_datetime_operations.py index 0e07175f2f3..afdf8b9796a 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-nullable/generated_tests/test_nullable_datetime_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-nullable/generated_tests/test_nullable_datetime_operations.py @@ -14,7 +14,7 @@ class TestNullableDatetimeOperations(NullableClientTestBase): @NullablePreparer() @recorded_by_proxy - def test_get_non_null(self, nullable_endpoint): + def test_datetime_get_non_null(self, nullable_endpoint): client = self.create_client(endpoint=nullable_endpoint) response = client.datetime.get_non_null() @@ -23,7 +23,7 @@ def test_get_non_null(self, nullable_endpoint): @NullablePreparer() @recorded_by_proxy - def test_get_null(self, nullable_endpoint): + def test_datetime_get_null(self, nullable_endpoint): client = self.create_client(endpoint=nullable_endpoint) response = client.datetime.get_null() @@ -32,7 +32,7 @@ def test_get_null(self, nullable_endpoint): @NullablePreparer() @recorded_by_proxy - def test_patch_non_null(self, nullable_endpoint): + def test_datetime_patch_non_null(self, nullable_endpoint): client = self.create_client(endpoint=nullable_endpoint) response = client.datetime.patch_non_null( body={"nullableProperty": "2020-02-20 00:00:00", "requiredProperty": "str"}, @@ -43,7 +43,7 @@ def test_patch_non_null(self, nullable_endpoint): @NullablePreparer() @recorded_by_proxy - def test_patch_null(self, nullable_endpoint): + def test_datetime_patch_null(self, nullable_endpoint): client = self.create_client(endpoint=nullable_endpoint) response = client.datetime.patch_null( body={"nullableProperty": "2020-02-20 00:00:00", "requiredProperty": "str"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-nullable/generated_tests/test_nullable_datetime_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-property-nullable/generated_tests/test_nullable_datetime_operations_async.py index 991344da5bf..0e3f62d7660 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-nullable/generated_tests/test_nullable_datetime_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-nullable/generated_tests/test_nullable_datetime_operations_async.py @@ -15,7 +15,7 @@ class TestNullableDatetimeOperationsAsync(NullableClientTestBaseAsync): @NullablePreparer() @recorded_by_proxy_async - async def test_get_non_null(self, nullable_endpoint): + async def test_datetime_get_non_null(self, nullable_endpoint): client = self.create_async_client(endpoint=nullable_endpoint) response = await client.datetime.get_non_null() @@ -24,7 +24,7 @@ async def test_get_non_null(self, nullable_endpoint): @NullablePreparer() @recorded_by_proxy_async - async def test_get_null(self, nullable_endpoint): + async def test_datetime_get_null(self, nullable_endpoint): client = self.create_async_client(endpoint=nullable_endpoint) response = await client.datetime.get_null() @@ -33,7 +33,7 @@ async def test_get_null(self, nullable_endpoint): @NullablePreparer() @recorded_by_proxy_async - async def test_patch_non_null(self, nullable_endpoint): + async def test_datetime_patch_non_null(self, nullable_endpoint): client = self.create_async_client(endpoint=nullable_endpoint) response = await client.datetime.patch_non_null( body={"nullableProperty": "2020-02-20 00:00:00", "requiredProperty": "str"}, @@ -44,7 +44,7 @@ async def test_patch_non_null(self, nullable_endpoint): @NullablePreparer() @recorded_by_proxy_async - async def test_patch_null(self, nullable_endpoint): + async def test_datetime_patch_null(self, nullable_endpoint): client = self.create_async_client(endpoint=nullable_endpoint) response = await client.datetime.patch_null( body={"nullableProperty": "2020-02-20 00:00:00", "requiredProperty": "str"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-nullable/generated_tests/test_nullable_duration_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-nullable/generated_tests/test_nullable_duration_operations.py index 1e868f5cb27..00c29045174 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-nullable/generated_tests/test_nullable_duration_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-nullable/generated_tests/test_nullable_duration_operations.py @@ -14,7 +14,7 @@ class TestNullableDurationOperations(NullableClientTestBase): @NullablePreparer() @recorded_by_proxy - def test_get_non_null(self, nullable_endpoint): + def test_duration_get_non_null(self, nullable_endpoint): client = self.create_client(endpoint=nullable_endpoint) response = client.duration.get_non_null() @@ -23,7 +23,7 @@ def test_get_non_null(self, nullable_endpoint): @NullablePreparer() @recorded_by_proxy - def test_get_null(self, nullable_endpoint): + def test_duration_get_null(self, nullable_endpoint): client = self.create_client(endpoint=nullable_endpoint) response = client.duration.get_null() @@ -32,7 +32,7 @@ def test_get_null(self, nullable_endpoint): @NullablePreparer() @recorded_by_proxy - def test_patch_non_null(self, nullable_endpoint): + def test_duration_patch_non_null(self, nullable_endpoint): client = self.create_client(endpoint=nullable_endpoint) response = client.duration.patch_non_null( body={"nullableProperty": "1 day, 0:00:00", "requiredProperty": "str"}, @@ -43,7 +43,7 @@ def test_patch_non_null(self, nullable_endpoint): @NullablePreparer() @recorded_by_proxy - def test_patch_null(self, nullable_endpoint): + def test_duration_patch_null(self, nullable_endpoint): client = self.create_client(endpoint=nullable_endpoint) response = client.duration.patch_null( body={"nullableProperty": "1 day, 0:00:00", "requiredProperty": "str"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-nullable/generated_tests/test_nullable_duration_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-property-nullable/generated_tests/test_nullable_duration_operations_async.py index 412822a04ce..e2fc03a01e0 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-nullable/generated_tests/test_nullable_duration_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-nullable/generated_tests/test_nullable_duration_operations_async.py @@ -15,7 +15,7 @@ class TestNullableDurationOperationsAsync(NullableClientTestBaseAsync): @NullablePreparer() @recorded_by_proxy_async - async def test_get_non_null(self, nullable_endpoint): + async def test_duration_get_non_null(self, nullable_endpoint): client = self.create_async_client(endpoint=nullable_endpoint) response = await client.duration.get_non_null() @@ -24,7 +24,7 @@ async def test_get_non_null(self, nullable_endpoint): @NullablePreparer() @recorded_by_proxy_async - async def test_get_null(self, nullable_endpoint): + async def test_duration_get_null(self, nullable_endpoint): client = self.create_async_client(endpoint=nullable_endpoint) response = await client.duration.get_null() @@ -33,7 +33,7 @@ async def test_get_null(self, nullable_endpoint): @NullablePreparer() @recorded_by_proxy_async - async def test_patch_non_null(self, nullable_endpoint): + async def test_duration_patch_non_null(self, nullable_endpoint): client = self.create_async_client(endpoint=nullable_endpoint) response = await client.duration.patch_non_null( body={"nullableProperty": "1 day, 0:00:00", "requiredProperty": "str"}, @@ -44,7 +44,7 @@ async def test_patch_non_null(self, nullable_endpoint): @NullablePreparer() @recorded_by_proxy_async - async def test_patch_null(self, nullable_endpoint): + async def test_duration_patch_null(self, nullable_endpoint): client = self.create_async_client(endpoint=nullable_endpoint) response = await client.duration.patch_null( body={"nullableProperty": "1 day, 0:00:00", "requiredProperty": "str"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-nullable/generated_tests/test_nullable_string_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-nullable/generated_tests/test_nullable_string_operations.py index 98a147d90a6..9dcc24d95a3 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-nullable/generated_tests/test_nullable_string_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-nullable/generated_tests/test_nullable_string_operations.py @@ -14,7 +14,7 @@ class TestNullableStringOperations(NullableClientTestBase): @NullablePreparer() @recorded_by_proxy - def test_get_non_null(self, nullable_endpoint): + def test_string_get_non_null(self, nullable_endpoint): client = self.create_client(endpoint=nullable_endpoint) response = client.string.get_non_null() @@ -23,7 +23,7 @@ def test_get_non_null(self, nullable_endpoint): @NullablePreparer() @recorded_by_proxy - def test_get_null(self, nullable_endpoint): + def test_string_get_null(self, nullable_endpoint): client = self.create_client(endpoint=nullable_endpoint) response = client.string.get_null() @@ -32,7 +32,7 @@ def test_get_null(self, nullable_endpoint): @NullablePreparer() @recorded_by_proxy - def test_patch_non_null(self, nullable_endpoint): + def test_string_patch_non_null(self, nullable_endpoint): client = self.create_client(endpoint=nullable_endpoint) response = client.string.patch_non_null( body={"nullableProperty": "str", "requiredProperty": "str"}, @@ -43,7 +43,7 @@ def test_patch_non_null(self, nullable_endpoint): @NullablePreparer() @recorded_by_proxy - def test_patch_null(self, nullable_endpoint): + def test_string_patch_null(self, nullable_endpoint): client = self.create_client(endpoint=nullable_endpoint) response = client.string.patch_null( body={"nullableProperty": "str", "requiredProperty": "str"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-nullable/generated_tests/test_nullable_string_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-property-nullable/generated_tests/test_nullable_string_operations_async.py index d18fb44cff5..dbf4e588182 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-nullable/generated_tests/test_nullable_string_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-nullable/generated_tests/test_nullable_string_operations_async.py @@ -15,7 +15,7 @@ class TestNullableStringOperationsAsync(NullableClientTestBaseAsync): @NullablePreparer() @recorded_by_proxy_async - async def test_get_non_null(self, nullable_endpoint): + async def test_string_get_non_null(self, nullable_endpoint): client = self.create_async_client(endpoint=nullable_endpoint) response = await client.string.get_non_null() @@ -24,7 +24,7 @@ async def test_get_non_null(self, nullable_endpoint): @NullablePreparer() @recorded_by_proxy_async - async def test_get_null(self, nullable_endpoint): + async def test_string_get_null(self, nullable_endpoint): client = self.create_async_client(endpoint=nullable_endpoint) response = await client.string.get_null() @@ -33,7 +33,7 @@ async def test_get_null(self, nullable_endpoint): @NullablePreparer() @recorded_by_proxy_async - async def test_patch_non_null(self, nullable_endpoint): + async def test_string_patch_non_null(self, nullable_endpoint): client = self.create_async_client(endpoint=nullable_endpoint) response = await client.string.patch_non_null( body={"nullableProperty": "str", "requiredProperty": "str"}, @@ -44,7 +44,7 @@ async def test_patch_non_null(self, nullable_endpoint): @NullablePreparer() @recorded_by_proxy_async - async def test_patch_null(self, nullable_endpoint): + async def test_string_patch_null(self, nullable_endpoint): client = self.create_async_client(endpoint=nullable_endpoint) response = await client.string.patch_null( body={"nullableProperty": "str", "requiredProperty": "str"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_boolean_literal_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_boolean_literal_operations.py index 11ccca613c7..54ed36a824b 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_boolean_literal_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_boolean_literal_operations.py @@ -14,7 +14,7 @@ class TestOptionalBooleanLiteralOperations(OptionalClientTestBase): @OptionalPreparer() @recorded_by_proxy - def test_get_all(self, optional_endpoint): + def test_boolean_literal_get_all(self, optional_endpoint): client = self.create_client(endpoint=optional_endpoint) response = client.boolean_literal.get_all() @@ -23,7 +23,7 @@ def test_get_all(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy - def test_get_default(self, optional_endpoint): + def test_boolean_literal_get_default(self, optional_endpoint): client = self.create_client(endpoint=optional_endpoint) response = client.boolean_literal.get_default() @@ -32,7 +32,7 @@ def test_get_default(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy - def test_put_all(self, optional_endpoint): + def test_boolean_literal_put_all(self, optional_endpoint): client = self.create_client(endpoint=optional_endpoint) response = client.boolean_literal.put_all( body={"property": True}, @@ -43,7 +43,7 @@ def test_put_all(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy - def test_put_default(self, optional_endpoint): + def test_boolean_literal_put_default(self, optional_endpoint): client = self.create_client(endpoint=optional_endpoint) response = client.boolean_literal.put_default( body={"property": True}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_boolean_literal_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_boolean_literal_operations_async.py index 8ad01ae1be9..30609287dc3 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_boolean_literal_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_boolean_literal_operations_async.py @@ -15,7 +15,7 @@ class TestOptionalBooleanLiteralOperationsAsync(OptionalClientTestBaseAsync): @OptionalPreparer() @recorded_by_proxy_async - async def test_get_all(self, optional_endpoint): + async def test_boolean_literal_get_all(self, optional_endpoint): client = self.create_async_client(endpoint=optional_endpoint) response = await client.boolean_literal.get_all() @@ -24,7 +24,7 @@ async def test_get_all(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy_async - async def test_get_default(self, optional_endpoint): + async def test_boolean_literal_get_default(self, optional_endpoint): client = self.create_async_client(endpoint=optional_endpoint) response = await client.boolean_literal.get_default() @@ -33,7 +33,7 @@ async def test_get_default(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy_async - async def test_put_all(self, optional_endpoint): + async def test_boolean_literal_put_all(self, optional_endpoint): client = self.create_async_client(endpoint=optional_endpoint) response = await client.boolean_literal.put_all( body={"property": True}, @@ -44,7 +44,7 @@ async def test_put_all(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy_async - async def test_put_default(self, optional_endpoint): + async def test_boolean_literal_put_default(self, optional_endpoint): client = self.create_async_client(endpoint=optional_endpoint) response = await client.boolean_literal.put_default( body={"property": True}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_bytes_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_bytes_operations.py index 5b9c1ee6e68..305d2612ee3 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_bytes_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_bytes_operations.py @@ -14,7 +14,7 @@ class TestOptionalBytesOperations(OptionalClientTestBase): @OptionalPreparer() @recorded_by_proxy - def test_get_all(self, optional_endpoint): + def test_bytes_get_all(self, optional_endpoint): client = self.create_client(endpoint=optional_endpoint) response = client.bytes.get_all() @@ -23,7 +23,7 @@ def test_get_all(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy - def test_get_default(self, optional_endpoint): + def test_bytes_get_default(self, optional_endpoint): client = self.create_client(endpoint=optional_endpoint) response = client.bytes.get_default() @@ -32,7 +32,7 @@ def test_get_default(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy - def test_put_all(self, optional_endpoint): + def test_bytes_put_all(self, optional_endpoint): client = self.create_client(endpoint=optional_endpoint) response = client.bytes.put_all( body={"property": bytes("bytes", encoding="utf-8")}, @@ -43,7 +43,7 @@ def test_put_all(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy - def test_put_default(self, optional_endpoint): + def test_bytes_put_default(self, optional_endpoint): client = self.create_client(endpoint=optional_endpoint) response = client.bytes.put_default( body={"property": bytes("bytes", encoding="utf-8")}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_bytes_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_bytes_operations_async.py index ce1765a18e8..ce7a116254f 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_bytes_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_bytes_operations_async.py @@ -15,7 +15,7 @@ class TestOptionalBytesOperationsAsync(OptionalClientTestBaseAsync): @OptionalPreparer() @recorded_by_proxy_async - async def test_get_all(self, optional_endpoint): + async def test_bytes_get_all(self, optional_endpoint): client = self.create_async_client(endpoint=optional_endpoint) response = await client.bytes.get_all() @@ -24,7 +24,7 @@ async def test_get_all(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy_async - async def test_get_default(self, optional_endpoint): + async def test_bytes_get_default(self, optional_endpoint): client = self.create_async_client(endpoint=optional_endpoint) response = await client.bytes.get_default() @@ -33,7 +33,7 @@ async def test_get_default(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy_async - async def test_put_all(self, optional_endpoint): + async def test_bytes_put_all(self, optional_endpoint): client = self.create_async_client(endpoint=optional_endpoint) response = await client.bytes.put_all( body={"property": bytes("bytes", encoding="utf-8")}, @@ -44,7 +44,7 @@ async def test_put_all(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy_async - async def test_put_default(self, optional_endpoint): + async def test_bytes_put_default(self, optional_endpoint): client = self.create_async_client(endpoint=optional_endpoint) response = await client.bytes.put_default( body={"property": bytes("bytes", encoding="utf-8")}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_collections_byte_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_collections_byte_operations.py index e5123103145..1f6dcf106f3 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_collections_byte_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_collections_byte_operations.py @@ -14,7 +14,7 @@ class TestOptionalCollectionsByteOperations(OptionalClientTestBase): @OptionalPreparer() @recorded_by_proxy - def test_get_all(self, optional_endpoint): + def test_collections_byte_get_all(self, optional_endpoint): client = self.create_client(endpoint=optional_endpoint) response = client.collections_byte.get_all() @@ -23,7 +23,7 @@ def test_get_all(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy - def test_get_default(self, optional_endpoint): + def test_collections_byte_get_default(self, optional_endpoint): client = self.create_client(endpoint=optional_endpoint) response = client.collections_byte.get_default() @@ -32,7 +32,7 @@ def test_get_default(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy - def test_put_all(self, optional_endpoint): + def test_collections_byte_put_all(self, optional_endpoint): client = self.create_client(endpoint=optional_endpoint) response = client.collections_byte.put_all( body={"property": [bytes("bytes", encoding="utf-8")]}, @@ -43,7 +43,7 @@ def test_put_all(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy - def test_put_default(self, optional_endpoint): + def test_collections_byte_put_default(self, optional_endpoint): client = self.create_client(endpoint=optional_endpoint) response = client.collections_byte.put_default( body={"property": [bytes("bytes", encoding="utf-8")]}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_collections_byte_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_collections_byte_operations_async.py index 24b7d5e3a03..896f44ea6ed 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_collections_byte_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_collections_byte_operations_async.py @@ -15,7 +15,7 @@ class TestOptionalCollectionsByteOperationsAsync(OptionalClientTestBaseAsync): @OptionalPreparer() @recorded_by_proxy_async - async def test_get_all(self, optional_endpoint): + async def test_collections_byte_get_all(self, optional_endpoint): client = self.create_async_client(endpoint=optional_endpoint) response = await client.collections_byte.get_all() @@ -24,7 +24,7 @@ async def test_get_all(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy_async - async def test_get_default(self, optional_endpoint): + async def test_collections_byte_get_default(self, optional_endpoint): client = self.create_async_client(endpoint=optional_endpoint) response = await client.collections_byte.get_default() @@ -33,7 +33,7 @@ async def test_get_default(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy_async - async def test_put_all(self, optional_endpoint): + async def test_collections_byte_put_all(self, optional_endpoint): client = self.create_async_client(endpoint=optional_endpoint) response = await client.collections_byte.put_all( body={"property": [bytes("bytes", encoding="utf-8")]}, @@ -44,7 +44,7 @@ async def test_put_all(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy_async - async def test_put_default(self, optional_endpoint): + async def test_collections_byte_put_default(self, optional_endpoint): client = self.create_async_client(endpoint=optional_endpoint) response = await client.collections_byte.put_default( body={"property": [bytes("bytes", encoding="utf-8")]}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_collections_model_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_collections_model_operations.py index 47216397212..18cc93f8a5a 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_collections_model_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_collections_model_operations.py @@ -14,7 +14,7 @@ class TestOptionalCollectionsModelOperations(OptionalClientTestBase): @OptionalPreparer() @recorded_by_proxy - def test_get_all(self, optional_endpoint): + def test_collections_model_get_all(self, optional_endpoint): client = self.create_client(endpoint=optional_endpoint) response = client.collections_model.get_all() @@ -23,7 +23,7 @@ def test_get_all(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy - def test_get_default(self, optional_endpoint): + def test_collections_model_get_default(self, optional_endpoint): client = self.create_client(endpoint=optional_endpoint) response = client.collections_model.get_default() @@ -32,7 +32,7 @@ def test_get_default(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy - def test_put_all(self, optional_endpoint): + def test_collections_model_put_all(self, optional_endpoint): client = self.create_client(endpoint=optional_endpoint) response = client.collections_model.put_all( body={"property": [{"property": "str"}]}, @@ -43,7 +43,7 @@ def test_put_all(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy - def test_put_default(self, optional_endpoint): + def test_collections_model_put_default(self, optional_endpoint): client = self.create_client(endpoint=optional_endpoint) response = client.collections_model.put_default( body={"property": [{"property": "str"}]}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_collections_model_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_collections_model_operations_async.py index eb353096888..06e36e8e9f8 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_collections_model_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_collections_model_operations_async.py @@ -15,7 +15,7 @@ class TestOptionalCollectionsModelOperationsAsync(OptionalClientTestBaseAsync): @OptionalPreparer() @recorded_by_proxy_async - async def test_get_all(self, optional_endpoint): + async def test_collections_model_get_all(self, optional_endpoint): client = self.create_async_client(endpoint=optional_endpoint) response = await client.collections_model.get_all() @@ -24,7 +24,7 @@ async def test_get_all(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy_async - async def test_get_default(self, optional_endpoint): + async def test_collections_model_get_default(self, optional_endpoint): client = self.create_async_client(endpoint=optional_endpoint) response = await client.collections_model.get_default() @@ -33,7 +33,7 @@ async def test_get_default(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy_async - async def test_put_all(self, optional_endpoint): + async def test_collections_model_put_all(self, optional_endpoint): client = self.create_async_client(endpoint=optional_endpoint) response = await client.collections_model.put_all( body={"property": [{"property": "str"}]}, @@ -44,7 +44,7 @@ async def test_put_all(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy_async - async def test_put_default(self, optional_endpoint): + async def test_collections_model_put_default(self, optional_endpoint): client = self.create_async_client(endpoint=optional_endpoint) response = await client.collections_model.put_default( body={"property": [{"property": "str"}]}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_datetime_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_datetime_operations.py index 40fc8123f15..bc19d57fef3 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_datetime_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_datetime_operations.py @@ -14,7 +14,7 @@ class TestOptionalDatetimeOperations(OptionalClientTestBase): @OptionalPreparer() @recorded_by_proxy - def test_get_all(self, optional_endpoint): + def test_datetime_get_all(self, optional_endpoint): client = self.create_client(endpoint=optional_endpoint) response = client.datetime.get_all() @@ -23,7 +23,7 @@ def test_get_all(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy - def test_get_default(self, optional_endpoint): + def test_datetime_get_default(self, optional_endpoint): client = self.create_client(endpoint=optional_endpoint) response = client.datetime.get_default() @@ -32,7 +32,7 @@ def test_get_default(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy - def test_put_all(self, optional_endpoint): + def test_datetime_put_all(self, optional_endpoint): client = self.create_client(endpoint=optional_endpoint) response = client.datetime.put_all( body={"property": "2020-02-20 00:00:00"}, @@ -43,7 +43,7 @@ def test_put_all(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy - def test_put_default(self, optional_endpoint): + def test_datetime_put_default(self, optional_endpoint): client = self.create_client(endpoint=optional_endpoint) response = client.datetime.put_default( body={"property": "2020-02-20 00:00:00"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_datetime_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_datetime_operations_async.py index 72a6a959016..280a0014040 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_datetime_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_datetime_operations_async.py @@ -15,7 +15,7 @@ class TestOptionalDatetimeOperationsAsync(OptionalClientTestBaseAsync): @OptionalPreparer() @recorded_by_proxy_async - async def test_get_all(self, optional_endpoint): + async def test_datetime_get_all(self, optional_endpoint): client = self.create_async_client(endpoint=optional_endpoint) response = await client.datetime.get_all() @@ -24,7 +24,7 @@ async def test_get_all(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy_async - async def test_get_default(self, optional_endpoint): + async def test_datetime_get_default(self, optional_endpoint): client = self.create_async_client(endpoint=optional_endpoint) response = await client.datetime.get_default() @@ -33,7 +33,7 @@ async def test_get_default(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy_async - async def test_put_all(self, optional_endpoint): + async def test_datetime_put_all(self, optional_endpoint): client = self.create_async_client(endpoint=optional_endpoint) response = await client.datetime.put_all( body={"property": "2020-02-20 00:00:00"}, @@ -44,7 +44,7 @@ async def test_put_all(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy_async - async def test_put_default(self, optional_endpoint): + async def test_datetime_put_default(self, optional_endpoint): client = self.create_async_client(endpoint=optional_endpoint) response = await client.datetime.put_default( body={"property": "2020-02-20 00:00:00"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_duration_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_duration_operations.py index 6c0539e2730..e920893260a 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_duration_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_duration_operations.py @@ -14,7 +14,7 @@ class TestOptionalDurationOperations(OptionalClientTestBase): @OptionalPreparer() @recorded_by_proxy - def test_get_all(self, optional_endpoint): + def test_duration_get_all(self, optional_endpoint): client = self.create_client(endpoint=optional_endpoint) response = client.duration.get_all() @@ -23,7 +23,7 @@ def test_get_all(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy - def test_get_default(self, optional_endpoint): + def test_duration_get_default(self, optional_endpoint): client = self.create_client(endpoint=optional_endpoint) response = client.duration.get_default() @@ -32,7 +32,7 @@ def test_get_default(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy - def test_put_all(self, optional_endpoint): + def test_duration_put_all(self, optional_endpoint): client = self.create_client(endpoint=optional_endpoint) response = client.duration.put_all( body={"property": "1 day, 0:00:00"}, @@ -43,7 +43,7 @@ def test_put_all(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy - def test_put_default(self, optional_endpoint): + def test_duration_put_default(self, optional_endpoint): client = self.create_client(endpoint=optional_endpoint) response = client.duration.put_default( body={"property": "1 day, 0:00:00"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_duration_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_duration_operations_async.py index 5302cbd4146..c31f449ec75 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_duration_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_duration_operations_async.py @@ -15,7 +15,7 @@ class TestOptionalDurationOperationsAsync(OptionalClientTestBaseAsync): @OptionalPreparer() @recorded_by_proxy_async - async def test_get_all(self, optional_endpoint): + async def test_duration_get_all(self, optional_endpoint): client = self.create_async_client(endpoint=optional_endpoint) response = await client.duration.get_all() @@ -24,7 +24,7 @@ async def test_get_all(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy_async - async def test_get_default(self, optional_endpoint): + async def test_duration_get_default(self, optional_endpoint): client = self.create_async_client(endpoint=optional_endpoint) response = await client.duration.get_default() @@ -33,7 +33,7 @@ async def test_get_default(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy_async - async def test_put_all(self, optional_endpoint): + async def test_duration_put_all(self, optional_endpoint): client = self.create_async_client(endpoint=optional_endpoint) response = await client.duration.put_all( body={"property": "1 day, 0:00:00"}, @@ -44,7 +44,7 @@ async def test_put_all(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy_async - async def test_put_default(self, optional_endpoint): + async def test_duration_put_default(self, optional_endpoint): client = self.create_async_client(endpoint=optional_endpoint) response = await client.duration.put_default( body={"property": "1 day, 0:00:00"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_float_literal_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_float_literal_operations.py index bd4989be9da..f546fda9550 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_float_literal_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_float_literal_operations.py @@ -14,7 +14,7 @@ class TestOptionalFloatLiteralOperations(OptionalClientTestBase): @OptionalPreparer() @recorded_by_proxy - def test_get_all(self, optional_endpoint): + def test_float_literal_get_all(self, optional_endpoint): client = self.create_client(endpoint=optional_endpoint) response = client.float_literal.get_all() @@ -23,7 +23,7 @@ def test_get_all(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy - def test_get_default(self, optional_endpoint): + def test_float_literal_get_default(self, optional_endpoint): client = self.create_client(endpoint=optional_endpoint) response = client.float_literal.get_default() @@ -32,7 +32,7 @@ def test_get_default(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy - def test_put_all(self, optional_endpoint): + def test_float_literal_put_all(self, optional_endpoint): client = self.create_client(endpoint=optional_endpoint) response = client.float_literal.put_all( body={"property": 1.25}, @@ -43,7 +43,7 @@ def test_put_all(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy - def test_put_default(self, optional_endpoint): + def test_float_literal_put_default(self, optional_endpoint): client = self.create_client(endpoint=optional_endpoint) response = client.float_literal.put_default( body={"property": 1.25}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_float_literal_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_float_literal_operations_async.py index 6c322bfbbe1..f10606012a1 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_float_literal_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_float_literal_operations_async.py @@ -15,7 +15,7 @@ class TestOptionalFloatLiteralOperationsAsync(OptionalClientTestBaseAsync): @OptionalPreparer() @recorded_by_proxy_async - async def test_get_all(self, optional_endpoint): + async def test_float_literal_get_all(self, optional_endpoint): client = self.create_async_client(endpoint=optional_endpoint) response = await client.float_literal.get_all() @@ -24,7 +24,7 @@ async def test_get_all(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy_async - async def test_get_default(self, optional_endpoint): + async def test_float_literal_get_default(self, optional_endpoint): client = self.create_async_client(endpoint=optional_endpoint) response = await client.float_literal.get_default() @@ -33,7 +33,7 @@ async def test_get_default(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy_async - async def test_put_all(self, optional_endpoint): + async def test_float_literal_put_all(self, optional_endpoint): client = self.create_async_client(endpoint=optional_endpoint) response = await client.float_literal.put_all( body={"property": 1.25}, @@ -44,7 +44,7 @@ async def test_put_all(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy_async - async def test_put_default(self, optional_endpoint): + async def test_float_literal_put_default(self, optional_endpoint): client = self.create_async_client(endpoint=optional_endpoint) response = await client.float_literal.put_default( body={"property": 1.25}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_int_literal_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_int_literal_operations.py index 051b469ee60..044da751628 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_int_literal_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_int_literal_operations.py @@ -14,7 +14,7 @@ class TestOptionalIntLiteralOperations(OptionalClientTestBase): @OptionalPreparer() @recorded_by_proxy - def test_get_all(self, optional_endpoint): + def test_int_literal_get_all(self, optional_endpoint): client = self.create_client(endpoint=optional_endpoint) response = client.int_literal.get_all() @@ -23,7 +23,7 @@ def test_get_all(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy - def test_get_default(self, optional_endpoint): + def test_int_literal_get_default(self, optional_endpoint): client = self.create_client(endpoint=optional_endpoint) response = client.int_literal.get_default() @@ -32,7 +32,7 @@ def test_get_default(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy - def test_put_all(self, optional_endpoint): + def test_int_literal_put_all(self, optional_endpoint): client = self.create_client(endpoint=optional_endpoint) response = client.int_literal.put_all( body={"property": 1}, @@ -43,7 +43,7 @@ def test_put_all(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy - def test_put_default(self, optional_endpoint): + def test_int_literal_put_default(self, optional_endpoint): client = self.create_client(endpoint=optional_endpoint) response = client.int_literal.put_default( body={"property": 1}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_int_literal_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_int_literal_operations_async.py index 2eb04adcf9b..a84ba860d26 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_int_literal_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_int_literal_operations_async.py @@ -15,7 +15,7 @@ class TestOptionalIntLiteralOperationsAsync(OptionalClientTestBaseAsync): @OptionalPreparer() @recorded_by_proxy_async - async def test_get_all(self, optional_endpoint): + async def test_int_literal_get_all(self, optional_endpoint): client = self.create_async_client(endpoint=optional_endpoint) response = await client.int_literal.get_all() @@ -24,7 +24,7 @@ async def test_get_all(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy_async - async def test_get_default(self, optional_endpoint): + async def test_int_literal_get_default(self, optional_endpoint): client = self.create_async_client(endpoint=optional_endpoint) response = await client.int_literal.get_default() @@ -33,7 +33,7 @@ async def test_get_default(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy_async - async def test_put_all(self, optional_endpoint): + async def test_int_literal_put_all(self, optional_endpoint): client = self.create_async_client(endpoint=optional_endpoint) response = await client.int_literal.put_all( body={"property": 1}, @@ -44,7 +44,7 @@ async def test_put_all(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy_async - async def test_put_default(self, optional_endpoint): + async def test_int_literal_put_default(self, optional_endpoint): client = self.create_async_client(endpoint=optional_endpoint) response = await client.int_literal.put_default( body={"property": 1}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_plain_date_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_plain_date_operations.py index 0b5a8851b58..8d7331a5528 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_plain_date_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_plain_date_operations.py @@ -14,7 +14,7 @@ class TestOptionalPlainDateOperations(OptionalClientTestBase): @OptionalPreparer() @recorded_by_proxy - def test_get_all(self, optional_endpoint): + def test_plain_date_get_all(self, optional_endpoint): client = self.create_client(endpoint=optional_endpoint) response = client.plain_date.get_all() @@ -23,7 +23,7 @@ def test_get_all(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy - def test_get_default(self, optional_endpoint): + def test_plain_date_get_default(self, optional_endpoint): client = self.create_client(endpoint=optional_endpoint) response = client.plain_date.get_default() @@ -32,7 +32,7 @@ def test_get_default(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy - def test_put_all(self, optional_endpoint): + def test_plain_date_put_all(self, optional_endpoint): client = self.create_client(endpoint=optional_endpoint) response = client.plain_date.put_all( body={"property": "2020-02-20"}, @@ -43,7 +43,7 @@ def test_put_all(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy - def test_put_default(self, optional_endpoint): + def test_plain_date_put_default(self, optional_endpoint): client = self.create_client(endpoint=optional_endpoint) response = client.plain_date.put_default( body={"property": "2020-02-20"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_plain_date_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_plain_date_operations_async.py index 9a9e415bd13..ecea48e2582 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_plain_date_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_plain_date_operations_async.py @@ -15,7 +15,7 @@ class TestOptionalPlainDateOperationsAsync(OptionalClientTestBaseAsync): @OptionalPreparer() @recorded_by_proxy_async - async def test_get_all(self, optional_endpoint): + async def test_plain_date_get_all(self, optional_endpoint): client = self.create_async_client(endpoint=optional_endpoint) response = await client.plain_date.get_all() @@ -24,7 +24,7 @@ async def test_get_all(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy_async - async def test_get_default(self, optional_endpoint): + async def test_plain_date_get_default(self, optional_endpoint): client = self.create_async_client(endpoint=optional_endpoint) response = await client.plain_date.get_default() @@ -33,7 +33,7 @@ async def test_get_default(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy_async - async def test_put_all(self, optional_endpoint): + async def test_plain_date_put_all(self, optional_endpoint): client = self.create_async_client(endpoint=optional_endpoint) response = await client.plain_date.put_all( body={"property": "2020-02-20"}, @@ -44,7 +44,7 @@ async def test_put_all(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy_async - async def test_put_default(self, optional_endpoint): + async def test_plain_date_put_default(self, optional_endpoint): client = self.create_async_client(endpoint=optional_endpoint) response = await client.plain_date.put_default( body={"property": "2020-02-20"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_plain_time_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_plain_time_operations.py index fea9fd0d349..223b55f35ea 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_plain_time_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_plain_time_operations.py @@ -14,7 +14,7 @@ class TestOptionalPlainTimeOperations(OptionalClientTestBase): @OptionalPreparer() @recorded_by_proxy - def test_get_all(self, optional_endpoint): + def test_plain_time_get_all(self, optional_endpoint): client = self.create_client(endpoint=optional_endpoint) response = client.plain_time.get_all() @@ -23,7 +23,7 @@ def test_get_all(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy - def test_get_default(self, optional_endpoint): + def test_plain_time_get_default(self, optional_endpoint): client = self.create_client(endpoint=optional_endpoint) response = client.plain_time.get_default() @@ -32,7 +32,7 @@ def test_get_default(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy - def test_put_all(self, optional_endpoint): + def test_plain_time_put_all(self, optional_endpoint): client = self.create_client(endpoint=optional_endpoint) response = client.plain_time.put_all( body={"property": "12:30:00"}, @@ -43,7 +43,7 @@ def test_put_all(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy - def test_put_default(self, optional_endpoint): + def test_plain_time_put_default(self, optional_endpoint): client = self.create_client(endpoint=optional_endpoint) response = client.plain_time.put_default( body={"property": "12:30:00"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_plain_time_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_plain_time_operations_async.py index 11998e13c74..062b2c1a48d 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_plain_time_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_plain_time_operations_async.py @@ -15,7 +15,7 @@ class TestOptionalPlainTimeOperationsAsync(OptionalClientTestBaseAsync): @OptionalPreparer() @recorded_by_proxy_async - async def test_get_all(self, optional_endpoint): + async def test_plain_time_get_all(self, optional_endpoint): client = self.create_async_client(endpoint=optional_endpoint) response = await client.plain_time.get_all() @@ -24,7 +24,7 @@ async def test_get_all(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy_async - async def test_get_default(self, optional_endpoint): + async def test_plain_time_get_default(self, optional_endpoint): client = self.create_async_client(endpoint=optional_endpoint) response = await client.plain_time.get_default() @@ -33,7 +33,7 @@ async def test_get_default(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy_async - async def test_put_all(self, optional_endpoint): + async def test_plain_time_put_all(self, optional_endpoint): client = self.create_async_client(endpoint=optional_endpoint) response = await client.plain_time.put_all( body={"property": "12:30:00"}, @@ -44,7 +44,7 @@ async def test_put_all(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy_async - async def test_put_default(self, optional_endpoint): + async def test_plain_time_put_default(self, optional_endpoint): client = self.create_async_client(endpoint=optional_endpoint) response = await client.plain_time.put_default( body={"property": "12:30:00"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_required_and_optional_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_required_and_optional_operations.py index f919499ba71..38b641dad1a 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_required_and_optional_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_required_and_optional_operations.py @@ -14,7 +14,7 @@ class TestOptionalRequiredAndOptionalOperations(OptionalClientTestBase): @OptionalPreparer() @recorded_by_proxy - def test_get_all(self, optional_endpoint): + def test_required_and_optional_get_all(self, optional_endpoint): client = self.create_client(endpoint=optional_endpoint) response = client.required_and_optional.get_all() @@ -23,7 +23,7 @@ def test_get_all(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy - def test_get_required_only(self, optional_endpoint): + def test_required_and_optional_get_required_only(self, optional_endpoint): client = self.create_client(endpoint=optional_endpoint) response = client.required_and_optional.get_required_only() @@ -32,7 +32,7 @@ def test_get_required_only(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy - def test_put_all(self, optional_endpoint): + def test_required_and_optional_put_all(self, optional_endpoint): client = self.create_client(endpoint=optional_endpoint) response = client.required_and_optional.put_all( body={"requiredProperty": 0, "optionalProperty": "str"}, @@ -43,7 +43,7 @@ def test_put_all(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy - def test_put_required_only(self, optional_endpoint): + def test_required_and_optional_put_required_only(self, optional_endpoint): client = self.create_client(endpoint=optional_endpoint) response = client.required_and_optional.put_required_only( body={"requiredProperty": 0, "optionalProperty": "str"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_required_and_optional_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_required_and_optional_operations_async.py index 0118df3b6ba..0d694036bda 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_required_and_optional_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_required_and_optional_operations_async.py @@ -15,7 +15,7 @@ class TestOptionalRequiredAndOptionalOperationsAsync(OptionalClientTestBaseAsync): @OptionalPreparer() @recorded_by_proxy_async - async def test_get_all(self, optional_endpoint): + async def test_required_and_optional_get_all(self, optional_endpoint): client = self.create_async_client(endpoint=optional_endpoint) response = await client.required_and_optional.get_all() @@ -24,7 +24,7 @@ async def test_get_all(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy_async - async def test_get_required_only(self, optional_endpoint): + async def test_required_and_optional_get_required_only(self, optional_endpoint): client = self.create_async_client(endpoint=optional_endpoint) response = await client.required_and_optional.get_required_only() @@ -33,7 +33,7 @@ async def test_get_required_only(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy_async - async def test_put_all(self, optional_endpoint): + async def test_required_and_optional_put_all(self, optional_endpoint): client = self.create_async_client(endpoint=optional_endpoint) response = await client.required_and_optional.put_all( body={"requiredProperty": 0, "optionalProperty": "str"}, @@ -44,7 +44,7 @@ async def test_put_all(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy_async - async def test_put_required_only(self, optional_endpoint): + async def test_required_and_optional_put_required_only(self, optional_endpoint): client = self.create_async_client(endpoint=optional_endpoint) response = await client.required_and_optional.put_required_only( body={"requiredProperty": 0, "optionalProperty": "str"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_string_literal_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_string_literal_operations.py index 5e70027c060..3c75efd4b0a 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_string_literal_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_string_literal_operations.py @@ -14,7 +14,7 @@ class TestOptionalStringLiteralOperations(OptionalClientTestBase): @OptionalPreparer() @recorded_by_proxy - def test_get_all(self, optional_endpoint): + def test_string_literal_get_all(self, optional_endpoint): client = self.create_client(endpoint=optional_endpoint) response = client.string_literal.get_all() @@ -23,7 +23,7 @@ def test_get_all(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy - def test_get_default(self, optional_endpoint): + def test_string_literal_get_default(self, optional_endpoint): client = self.create_client(endpoint=optional_endpoint) response = client.string_literal.get_default() @@ -32,7 +32,7 @@ def test_get_default(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy - def test_put_all(self, optional_endpoint): + def test_string_literal_put_all(self, optional_endpoint): client = self.create_client(endpoint=optional_endpoint) response = client.string_literal.put_all( body={"property": "hello"}, @@ -43,7 +43,7 @@ def test_put_all(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy - def test_put_default(self, optional_endpoint): + def test_string_literal_put_default(self, optional_endpoint): client = self.create_client(endpoint=optional_endpoint) response = client.string_literal.put_default( body={"property": "hello"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_string_literal_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_string_literal_operations_async.py index b67e3e35db9..0f48cbf56a8 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_string_literal_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_string_literal_operations_async.py @@ -15,7 +15,7 @@ class TestOptionalStringLiteralOperationsAsync(OptionalClientTestBaseAsync): @OptionalPreparer() @recorded_by_proxy_async - async def test_get_all(self, optional_endpoint): + async def test_string_literal_get_all(self, optional_endpoint): client = self.create_async_client(endpoint=optional_endpoint) response = await client.string_literal.get_all() @@ -24,7 +24,7 @@ async def test_get_all(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy_async - async def test_get_default(self, optional_endpoint): + async def test_string_literal_get_default(self, optional_endpoint): client = self.create_async_client(endpoint=optional_endpoint) response = await client.string_literal.get_default() @@ -33,7 +33,7 @@ async def test_get_default(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy_async - async def test_put_all(self, optional_endpoint): + async def test_string_literal_put_all(self, optional_endpoint): client = self.create_async_client(endpoint=optional_endpoint) response = await client.string_literal.put_all( body={"property": "hello"}, @@ -44,7 +44,7 @@ async def test_put_all(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy_async - async def test_put_default(self, optional_endpoint): + async def test_string_literal_put_default(self, optional_endpoint): client = self.create_async_client(endpoint=optional_endpoint) response = await client.string_literal.put_default( body={"property": "hello"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_string_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_string_operations.py index 7aa462cb90f..1dcc560ba06 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_string_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_string_operations.py @@ -14,7 +14,7 @@ class TestOptionalStringOperations(OptionalClientTestBase): @OptionalPreparer() @recorded_by_proxy - def test_get_all(self, optional_endpoint): + def test_string_get_all(self, optional_endpoint): client = self.create_client(endpoint=optional_endpoint) response = client.string.get_all() @@ -23,7 +23,7 @@ def test_get_all(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy - def test_get_default(self, optional_endpoint): + def test_string_get_default(self, optional_endpoint): client = self.create_client(endpoint=optional_endpoint) response = client.string.get_default() @@ -32,7 +32,7 @@ def test_get_default(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy - def test_put_all(self, optional_endpoint): + def test_string_put_all(self, optional_endpoint): client = self.create_client(endpoint=optional_endpoint) response = client.string.put_all( body={"property": "str"}, @@ -43,7 +43,7 @@ def test_put_all(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy - def test_put_default(self, optional_endpoint): + def test_string_put_default(self, optional_endpoint): client = self.create_client(endpoint=optional_endpoint) response = client.string.put_default( body={"property": "str"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_string_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_string_operations_async.py index 5e78002451b..d757488c9b5 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_string_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_string_operations_async.py @@ -15,7 +15,7 @@ class TestOptionalStringOperationsAsync(OptionalClientTestBaseAsync): @OptionalPreparer() @recorded_by_proxy_async - async def test_get_all(self, optional_endpoint): + async def test_string_get_all(self, optional_endpoint): client = self.create_async_client(endpoint=optional_endpoint) response = await client.string.get_all() @@ -24,7 +24,7 @@ async def test_get_all(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy_async - async def test_get_default(self, optional_endpoint): + async def test_string_get_default(self, optional_endpoint): client = self.create_async_client(endpoint=optional_endpoint) response = await client.string.get_default() @@ -33,7 +33,7 @@ async def test_get_default(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy_async - async def test_put_all(self, optional_endpoint): + async def test_string_put_all(self, optional_endpoint): client = self.create_async_client(endpoint=optional_endpoint) response = await client.string.put_all( body={"property": "str"}, @@ -44,7 +44,7 @@ async def test_put_all(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy_async - async def test_put_default(self, optional_endpoint): + async def test_string_put_default(self, optional_endpoint): client = self.create_async_client(endpoint=optional_endpoint) response = await client.string.put_default( body={"property": "str"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_union_float_literal_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_union_float_literal_operations.py index 5d5be8d68d6..775c2e338e9 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_union_float_literal_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_union_float_literal_operations.py @@ -14,7 +14,7 @@ class TestOptionalUnionFloatLiteralOperations(OptionalClientTestBase): @OptionalPreparer() @recorded_by_proxy - def test_get_all(self, optional_endpoint): + def test_union_float_literal_get_all(self, optional_endpoint): client = self.create_client(endpoint=optional_endpoint) response = client.union_float_literal.get_all() @@ -23,7 +23,7 @@ def test_get_all(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy - def test_get_default(self, optional_endpoint): + def test_union_float_literal_get_default(self, optional_endpoint): client = self.create_client(endpoint=optional_endpoint) response = client.union_float_literal.get_default() @@ -32,7 +32,7 @@ def test_get_default(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy - def test_put_all(self, optional_endpoint): + def test_union_float_literal_put_all(self, optional_endpoint): client = self.create_client(endpoint=optional_endpoint) response = client.union_float_literal.put_all( body={"property": 1.25}, @@ -43,7 +43,7 @@ def test_put_all(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy - def test_put_default(self, optional_endpoint): + def test_union_float_literal_put_default(self, optional_endpoint): client = self.create_client(endpoint=optional_endpoint) response = client.union_float_literal.put_default( body={"property": 1.25}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_union_float_literal_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_union_float_literal_operations_async.py index b1f4a457f45..1c7555ba53e 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_union_float_literal_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_union_float_literal_operations_async.py @@ -15,7 +15,7 @@ class TestOptionalUnionFloatLiteralOperationsAsync(OptionalClientTestBaseAsync): @OptionalPreparer() @recorded_by_proxy_async - async def test_get_all(self, optional_endpoint): + async def test_union_float_literal_get_all(self, optional_endpoint): client = self.create_async_client(endpoint=optional_endpoint) response = await client.union_float_literal.get_all() @@ -24,7 +24,7 @@ async def test_get_all(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy_async - async def test_get_default(self, optional_endpoint): + async def test_union_float_literal_get_default(self, optional_endpoint): client = self.create_async_client(endpoint=optional_endpoint) response = await client.union_float_literal.get_default() @@ -33,7 +33,7 @@ async def test_get_default(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy_async - async def test_put_all(self, optional_endpoint): + async def test_union_float_literal_put_all(self, optional_endpoint): client = self.create_async_client(endpoint=optional_endpoint) response = await client.union_float_literal.put_all( body={"property": 1.25}, @@ -44,7 +44,7 @@ async def test_put_all(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy_async - async def test_put_default(self, optional_endpoint): + async def test_union_float_literal_put_default(self, optional_endpoint): client = self.create_async_client(endpoint=optional_endpoint) response = await client.union_float_literal.put_default( body={"property": 1.25}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_union_int_literal_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_union_int_literal_operations.py index 8d682adb9bf..a301c507aea 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_union_int_literal_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_union_int_literal_operations.py @@ -14,7 +14,7 @@ class TestOptionalUnionIntLiteralOperations(OptionalClientTestBase): @OptionalPreparer() @recorded_by_proxy - def test_get_all(self, optional_endpoint): + def test_union_int_literal_get_all(self, optional_endpoint): client = self.create_client(endpoint=optional_endpoint) response = client.union_int_literal.get_all() @@ -23,7 +23,7 @@ def test_get_all(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy - def test_get_default(self, optional_endpoint): + def test_union_int_literal_get_default(self, optional_endpoint): client = self.create_client(endpoint=optional_endpoint) response = client.union_int_literal.get_default() @@ -32,7 +32,7 @@ def test_get_default(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy - def test_put_all(self, optional_endpoint): + def test_union_int_literal_put_all(self, optional_endpoint): client = self.create_client(endpoint=optional_endpoint) response = client.union_int_literal.put_all( body={"property": 1}, @@ -43,7 +43,7 @@ def test_put_all(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy - def test_put_default(self, optional_endpoint): + def test_union_int_literal_put_default(self, optional_endpoint): client = self.create_client(endpoint=optional_endpoint) response = client.union_int_literal.put_default( body={"property": 1}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_union_int_literal_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_union_int_literal_operations_async.py index 0e2a0baf487..552dbfca317 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_union_int_literal_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_union_int_literal_operations_async.py @@ -15,7 +15,7 @@ class TestOptionalUnionIntLiteralOperationsAsync(OptionalClientTestBaseAsync): @OptionalPreparer() @recorded_by_proxy_async - async def test_get_all(self, optional_endpoint): + async def test_union_int_literal_get_all(self, optional_endpoint): client = self.create_async_client(endpoint=optional_endpoint) response = await client.union_int_literal.get_all() @@ -24,7 +24,7 @@ async def test_get_all(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy_async - async def test_get_default(self, optional_endpoint): + async def test_union_int_literal_get_default(self, optional_endpoint): client = self.create_async_client(endpoint=optional_endpoint) response = await client.union_int_literal.get_default() @@ -33,7 +33,7 @@ async def test_get_default(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy_async - async def test_put_all(self, optional_endpoint): + async def test_union_int_literal_put_all(self, optional_endpoint): client = self.create_async_client(endpoint=optional_endpoint) response = await client.union_int_literal.put_all( body={"property": 1}, @@ -44,7 +44,7 @@ async def test_put_all(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy_async - async def test_put_default(self, optional_endpoint): + async def test_union_int_literal_put_default(self, optional_endpoint): client = self.create_async_client(endpoint=optional_endpoint) response = await client.union_int_literal.put_default( body={"property": 1}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_union_string_literal_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_union_string_literal_operations.py index 8a19fca060c..4cde960c6d4 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_union_string_literal_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_union_string_literal_operations.py @@ -14,7 +14,7 @@ class TestOptionalUnionStringLiteralOperations(OptionalClientTestBase): @OptionalPreparer() @recorded_by_proxy - def test_get_all(self, optional_endpoint): + def test_union_string_literal_get_all(self, optional_endpoint): client = self.create_client(endpoint=optional_endpoint) response = client.union_string_literal.get_all() @@ -23,7 +23,7 @@ def test_get_all(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy - def test_get_default(self, optional_endpoint): + def test_union_string_literal_get_default(self, optional_endpoint): client = self.create_client(endpoint=optional_endpoint) response = client.union_string_literal.get_default() @@ -32,7 +32,7 @@ def test_get_default(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy - def test_put_all(self, optional_endpoint): + def test_union_string_literal_put_all(self, optional_endpoint): client = self.create_client(endpoint=optional_endpoint) response = client.union_string_literal.put_all( body={"property": "hello"}, @@ -43,7 +43,7 @@ def test_put_all(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy - def test_put_default(self, optional_endpoint): + def test_union_string_literal_put_default(self, optional_endpoint): client = self.create_client(endpoint=optional_endpoint) response = client.union_string_literal.put_default( body={"property": "hello"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_union_string_literal_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_union_string_literal_operations_async.py index f29fc1ab1bd..785ec15fdc2 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_union_string_literal_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-optional/generated_tests/test_optional_union_string_literal_operations_async.py @@ -15,7 +15,7 @@ class TestOptionalUnionStringLiteralOperationsAsync(OptionalClientTestBaseAsync): @OptionalPreparer() @recorded_by_proxy_async - async def test_get_all(self, optional_endpoint): + async def test_union_string_literal_get_all(self, optional_endpoint): client = self.create_async_client(endpoint=optional_endpoint) response = await client.union_string_literal.get_all() @@ -24,7 +24,7 @@ async def test_get_all(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy_async - async def test_get_default(self, optional_endpoint): + async def test_union_string_literal_get_default(self, optional_endpoint): client = self.create_async_client(endpoint=optional_endpoint) response = await client.union_string_literal.get_default() @@ -33,7 +33,7 @@ async def test_get_default(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy_async - async def test_put_all(self, optional_endpoint): + async def test_union_string_literal_put_all(self, optional_endpoint): client = self.create_async_client(endpoint=optional_endpoint) response = await client.union_string_literal.put_all( body={"property": "hello"}, @@ -44,7 +44,7 @@ async def test_put_all(self, optional_endpoint): @OptionalPreparer() @recorded_by_proxy_async - async def test_put_default(self, optional_endpoint): + async def test_union_string_literal_put_default(self, optional_endpoint): client = self.create_async_client(endpoint=optional_endpoint) response = await client.union_string_literal.put_default( body={"property": "hello"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_boolean_literal_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_boolean_literal_operations.py index 6cd46cff86e..c3c3d54b963 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_boolean_literal_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_boolean_literal_operations.py @@ -14,7 +14,7 @@ class TestValueTypesBooleanLiteralOperations(ValueTypesClientTestBase): @ValueTypesPreparer() @recorded_by_proxy - def test_get(self, valuetypes_endpoint): + def test_boolean_literal_get(self, valuetypes_endpoint): client = self.create_client(endpoint=valuetypes_endpoint) response = client.boolean_literal.get() @@ -23,7 +23,7 @@ def test_get(self, valuetypes_endpoint): @ValueTypesPreparer() @recorded_by_proxy - def test_put(self, valuetypes_endpoint): + def test_boolean_literal_put(self, valuetypes_endpoint): client = self.create_client(endpoint=valuetypes_endpoint) response = client.boolean_literal.put( body={"property": True}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_boolean_literal_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_boolean_literal_operations_async.py index 9de26ba28b9..e8c8189aae4 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_boolean_literal_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_boolean_literal_operations_async.py @@ -15,7 +15,7 @@ class TestValueTypesBooleanLiteralOperationsAsync(ValueTypesClientTestBaseAsync): @ValueTypesPreparer() @recorded_by_proxy_async - async def test_get(self, valuetypes_endpoint): + async def test_boolean_literal_get(self, valuetypes_endpoint): client = self.create_async_client(endpoint=valuetypes_endpoint) response = await client.boolean_literal.get() @@ -24,7 +24,7 @@ async def test_get(self, valuetypes_endpoint): @ValueTypesPreparer() @recorded_by_proxy_async - async def test_put(self, valuetypes_endpoint): + async def test_boolean_literal_put(self, valuetypes_endpoint): client = self.create_async_client(endpoint=valuetypes_endpoint) response = await client.boolean_literal.put( body={"property": True}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_boolean_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_boolean_operations.py index 605f44ac6d8..51309ac9860 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_boolean_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_boolean_operations.py @@ -14,7 +14,7 @@ class TestValueTypesBooleanOperations(ValueTypesClientTestBase): @ValueTypesPreparer() @recorded_by_proxy - def test_get(self, valuetypes_endpoint): + def test_boolean_get(self, valuetypes_endpoint): client = self.create_client(endpoint=valuetypes_endpoint) response = client.boolean.get() @@ -23,7 +23,7 @@ def test_get(self, valuetypes_endpoint): @ValueTypesPreparer() @recorded_by_proxy - def test_put(self, valuetypes_endpoint): + def test_boolean_put(self, valuetypes_endpoint): client = self.create_client(endpoint=valuetypes_endpoint) response = client.boolean.put( body={"property": bool}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_boolean_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_boolean_operations_async.py index 7ebd874bdd8..069b7a93c2b 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_boolean_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_boolean_operations_async.py @@ -15,7 +15,7 @@ class TestValueTypesBooleanOperationsAsync(ValueTypesClientTestBaseAsync): @ValueTypesPreparer() @recorded_by_proxy_async - async def test_get(self, valuetypes_endpoint): + async def test_boolean_get(self, valuetypes_endpoint): client = self.create_async_client(endpoint=valuetypes_endpoint) response = await client.boolean.get() @@ -24,7 +24,7 @@ async def test_get(self, valuetypes_endpoint): @ValueTypesPreparer() @recorded_by_proxy_async - async def test_put(self, valuetypes_endpoint): + async def test_boolean_put(self, valuetypes_endpoint): client = self.create_async_client(endpoint=valuetypes_endpoint) response = await client.boolean.put( body={"property": bool}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_bytes_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_bytes_operations.py index 57f5807c522..3f08982c2f8 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_bytes_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_bytes_operations.py @@ -14,7 +14,7 @@ class TestValueTypesBytesOperations(ValueTypesClientTestBase): @ValueTypesPreparer() @recorded_by_proxy - def test_get(self, valuetypes_endpoint): + def test_bytes_get(self, valuetypes_endpoint): client = self.create_client(endpoint=valuetypes_endpoint) response = client.bytes.get() @@ -23,7 +23,7 @@ def test_get(self, valuetypes_endpoint): @ValueTypesPreparer() @recorded_by_proxy - def test_put(self, valuetypes_endpoint): + def test_bytes_put(self, valuetypes_endpoint): client = self.create_client(endpoint=valuetypes_endpoint) response = client.bytes.put( body={"property": bytes("bytes", encoding="utf-8")}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_bytes_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_bytes_operations_async.py index 6f2e5cd718e..dd9dcffc483 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_bytes_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_bytes_operations_async.py @@ -15,7 +15,7 @@ class TestValueTypesBytesOperationsAsync(ValueTypesClientTestBaseAsync): @ValueTypesPreparer() @recorded_by_proxy_async - async def test_get(self, valuetypes_endpoint): + async def test_bytes_get(self, valuetypes_endpoint): client = self.create_async_client(endpoint=valuetypes_endpoint) response = await client.bytes.get() @@ -24,7 +24,7 @@ async def test_get(self, valuetypes_endpoint): @ValueTypesPreparer() @recorded_by_proxy_async - async def test_put(self, valuetypes_endpoint): + async def test_bytes_put(self, valuetypes_endpoint): client = self.create_async_client(endpoint=valuetypes_endpoint) response = await client.bytes.put( body={"property": bytes("bytes", encoding="utf-8")}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_collections_int_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_collections_int_operations.py index ce919b8a0f0..df06ce23f99 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_collections_int_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_collections_int_operations.py @@ -14,7 +14,7 @@ class TestValueTypesCollectionsIntOperations(ValueTypesClientTestBase): @ValueTypesPreparer() @recorded_by_proxy - def test_get(self, valuetypes_endpoint): + def test_collections_int_get(self, valuetypes_endpoint): client = self.create_client(endpoint=valuetypes_endpoint) response = client.collections_int.get() @@ -23,7 +23,7 @@ def test_get(self, valuetypes_endpoint): @ValueTypesPreparer() @recorded_by_proxy - def test_put(self, valuetypes_endpoint): + def test_collections_int_put(self, valuetypes_endpoint): client = self.create_client(endpoint=valuetypes_endpoint) response = client.collections_int.put( body={"property": [0]}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_collections_int_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_collections_int_operations_async.py index 2724134d5ca..51b31ffdd77 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_collections_int_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_collections_int_operations_async.py @@ -15,7 +15,7 @@ class TestValueTypesCollectionsIntOperationsAsync(ValueTypesClientTestBaseAsync): @ValueTypesPreparer() @recorded_by_proxy_async - async def test_get(self, valuetypes_endpoint): + async def test_collections_int_get(self, valuetypes_endpoint): client = self.create_async_client(endpoint=valuetypes_endpoint) response = await client.collections_int.get() @@ -24,7 +24,7 @@ async def test_get(self, valuetypes_endpoint): @ValueTypesPreparer() @recorded_by_proxy_async - async def test_put(self, valuetypes_endpoint): + async def test_collections_int_put(self, valuetypes_endpoint): client = self.create_async_client(endpoint=valuetypes_endpoint) response = await client.collections_int.put( body={"property": [0]}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_collections_model_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_collections_model_operations.py index 67a023f4241..8fcab968ccd 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_collections_model_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_collections_model_operations.py @@ -14,7 +14,7 @@ class TestValueTypesCollectionsModelOperations(ValueTypesClientTestBase): @ValueTypesPreparer() @recorded_by_proxy - def test_get(self, valuetypes_endpoint): + def test_collections_model_get(self, valuetypes_endpoint): client = self.create_client(endpoint=valuetypes_endpoint) response = client.collections_model.get() @@ -23,7 +23,7 @@ def test_get(self, valuetypes_endpoint): @ValueTypesPreparer() @recorded_by_proxy - def test_put(self, valuetypes_endpoint): + def test_collections_model_put(self, valuetypes_endpoint): client = self.create_client(endpoint=valuetypes_endpoint) response = client.collections_model.put( body={"property": [{"property": "str"}]}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_collections_model_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_collections_model_operations_async.py index 797ee4471fd..991461dc3dd 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_collections_model_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_collections_model_operations_async.py @@ -15,7 +15,7 @@ class TestValueTypesCollectionsModelOperationsAsync(ValueTypesClientTestBaseAsync): @ValueTypesPreparer() @recorded_by_proxy_async - async def test_get(self, valuetypes_endpoint): + async def test_collections_model_get(self, valuetypes_endpoint): client = self.create_async_client(endpoint=valuetypes_endpoint) response = await client.collections_model.get() @@ -24,7 +24,7 @@ async def test_get(self, valuetypes_endpoint): @ValueTypesPreparer() @recorded_by_proxy_async - async def test_put(self, valuetypes_endpoint): + async def test_collections_model_put(self, valuetypes_endpoint): client = self.create_async_client(endpoint=valuetypes_endpoint) response = await client.collections_model.put( body={"property": [{"property": "str"}]}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_collections_string_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_collections_string_operations.py index 9c35759a770..1ab22215eab 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_collections_string_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_collections_string_operations.py @@ -14,7 +14,7 @@ class TestValueTypesCollectionsStringOperations(ValueTypesClientTestBase): @ValueTypesPreparer() @recorded_by_proxy - def test_get(self, valuetypes_endpoint): + def test_collections_string_get(self, valuetypes_endpoint): client = self.create_client(endpoint=valuetypes_endpoint) response = client.collections_string.get() @@ -23,7 +23,7 @@ def test_get(self, valuetypes_endpoint): @ValueTypesPreparer() @recorded_by_proxy - def test_put(self, valuetypes_endpoint): + def test_collections_string_put(self, valuetypes_endpoint): client = self.create_client(endpoint=valuetypes_endpoint) response = client.collections_string.put( body={"property": ["str"]}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_collections_string_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_collections_string_operations_async.py index a9e9b0e78b4..cb8e324ceb2 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_collections_string_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_collections_string_operations_async.py @@ -15,7 +15,7 @@ class TestValueTypesCollectionsStringOperationsAsync(ValueTypesClientTestBaseAsync): @ValueTypesPreparer() @recorded_by_proxy_async - async def test_get(self, valuetypes_endpoint): + async def test_collections_string_get(self, valuetypes_endpoint): client = self.create_async_client(endpoint=valuetypes_endpoint) response = await client.collections_string.get() @@ -24,7 +24,7 @@ async def test_get(self, valuetypes_endpoint): @ValueTypesPreparer() @recorded_by_proxy_async - async def test_put(self, valuetypes_endpoint): + async def test_collections_string_put(self, valuetypes_endpoint): client = self.create_async_client(endpoint=valuetypes_endpoint) response = await client.collections_string.put( body={"property": ["str"]}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_datetime_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_datetime_operations.py index 41b253683b7..a0eaa45c66a 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_datetime_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_datetime_operations.py @@ -14,7 +14,7 @@ class TestValueTypesDatetimeOperations(ValueTypesClientTestBase): @ValueTypesPreparer() @recorded_by_proxy - def test_get(self, valuetypes_endpoint): + def test_datetime_get(self, valuetypes_endpoint): client = self.create_client(endpoint=valuetypes_endpoint) response = client.datetime.get() @@ -23,7 +23,7 @@ def test_get(self, valuetypes_endpoint): @ValueTypesPreparer() @recorded_by_proxy - def test_put(self, valuetypes_endpoint): + def test_datetime_put(self, valuetypes_endpoint): client = self.create_client(endpoint=valuetypes_endpoint) response = client.datetime.put( body={"property": "2020-02-20 00:00:00"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_datetime_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_datetime_operations_async.py index b747d891a1b..888caa316a4 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_datetime_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_datetime_operations_async.py @@ -15,7 +15,7 @@ class TestValueTypesDatetimeOperationsAsync(ValueTypesClientTestBaseAsync): @ValueTypesPreparer() @recorded_by_proxy_async - async def test_get(self, valuetypes_endpoint): + async def test_datetime_get(self, valuetypes_endpoint): client = self.create_async_client(endpoint=valuetypes_endpoint) response = await client.datetime.get() @@ -24,7 +24,7 @@ async def test_get(self, valuetypes_endpoint): @ValueTypesPreparer() @recorded_by_proxy_async - async def test_put(self, valuetypes_endpoint): + async def test_datetime_put(self, valuetypes_endpoint): client = self.create_async_client(endpoint=valuetypes_endpoint) response = await client.datetime.put( body={"property": "2020-02-20 00:00:00"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_decimal128_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_decimal128_operations.py index 9845d787fe3..00676e9f6a1 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_decimal128_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_decimal128_operations.py @@ -14,7 +14,7 @@ class TestValueTypesDecimal128Operations(ValueTypesClientTestBase): @ValueTypesPreparer() @recorded_by_proxy - def test_get(self, valuetypes_endpoint): + def test_decimal128_get(self, valuetypes_endpoint): client = self.create_client(endpoint=valuetypes_endpoint) response = client.decimal128.get() @@ -23,7 +23,7 @@ def test_get(self, valuetypes_endpoint): @ValueTypesPreparer() @recorded_by_proxy - def test_put(self, valuetypes_endpoint): + def test_decimal128_put(self, valuetypes_endpoint): client = self.create_client(endpoint=valuetypes_endpoint) response = client.decimal128.put( body={"property": 0.0}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_decimal128_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_decimal128_operations_async.py index 21286c3bee1..605c463e8df 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_decimal128_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_decimal128_operations_async.py @@ -15,7 +15,7 @@ class TestValueTypesDecimal128OperationsAsync(ValueTypesClientTestBaseAsync): @ValueTypesPreparer() @recorded_by_proxy_async - async def test_get(self, valuetypes_endpoint): + async def test_decimal128_get(self, valuetypes_endpoint): client = self.create_async_client(endpoint=valuetypes_endpoint) response = await client.decimal128.get() @@ -24,7 +24,7 @@ async def test_get(self, valuetypes_endpoint): @ValueTypesPreparer() @recorded_by_proxy_async - async def test_put(self, valuetypes_endpoint): + async def test_decimal128_put(self, valuetypes_endpoint): client = self.create_async_client(endpoint=valuetypes_endpoint) response = await client.decimal128.put( body={"property": 0.0}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_decimal_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_decimal_operations.py index 5c01f5d5483..f495eea2814 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_decimal_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_decimal_operations.py @@ -14,7 +14,7 @@ class TestValueTypesDecimalOperations(ValueTypesClientTestBase): @ValueTypesPreparer() @recorded_by_proxy - def test_get(self, valuetypes_endpoint): + def test_decimal_get(self, valuetypes_endpoint): client = self.create_client(endpoint=valuetypes_endpoint) response = client.decimal.get() @@ -23,7 +23,7 @@ def test_get(self, valuetypes_endpoint): @ValueTypesPreparer() @recorded_by_proxy - def test_put(self, valuetypes_endpoint): + def test_decimal_put(self, valuetypes_endpoint): client = self.create_client(endpoint=valuetypes_endpoint) response = client.decimal.put( body={"property": 0.0}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_decimal_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_decimal_operations_async.py index 7107aa94302..7153118e60d 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_decimal_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_decimal_operations_async.py @@ -15,7 +15,7 @@ class TestValueTypesDecimalOperationsAsync(ValueTypesClientTestBaseAsync): @ValueTypesPreparer() @recorded_by_proxy_async - async def test_get(self, valuetypes_endpoint): + async def test_decimal_get(self, valuetypes_endpoint): client = self.create_async_client(endpoint=valuetypes_endpoint) response = await client.decimal.get() @@ -24,7 +24,7 @@ async def test_get(self, valuetypes_endpoint): @ValueTypesPreparer() @recorded_by_proxy_async - async def test_put(self, valuetypes_endpoint): + async def test_decimal_put(self, valuetypes_endpoint): client = self.create_async_client(endpoint=valuetypes_endpoint) response = await client.decimal.put( body={"property": 0.0}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_dictionary_string_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_dictionary_string_operations.py index 7972b767ffd..9e09f1d71f4 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_dictionary_string_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_dictionary_string_operations.py @@ -14,7 +14,7 @@ class TestValueTypesDictionaryStringOperations(ValueTypesClientTestBase): @ValueTypesPreparer() @recorded_by_proxy - def test_get(self, valuetypes_endpoint): + def test_dictionary_string_get(self, valuetypes_endpoint): client = self.create_client(endpoint=valuetypes_endpoint) response = client.dictionary_string.get() @@ -23,7 +23,7 @@ def test_get(self, valuetypes_endpoint): @ValueTypesPreparer() @recorded_by_proxy - def test_put(self, valuetypes_endpoint): + def test_dictionary_string_put(self, valuetypes_endpoint): client = self.create_client(endpoint=valuetypes_endpoint) response = client.dictionary_string.put( body={"property": {"str": "str"}}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_dictionary_string_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_dictionary_string_operations_async.py index d1f05e98d64..f24b8b13007 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_dictionary_string_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_dictionary_string_operations_async.py @@ -15,7 +15,7 @@ class TestValueTypesDictionaryStringOperationsAsync(ValueTypesClientTestBaseAsync): @ValueTypesPreparer() @recorded_by_proxy_async - async def test_get(self, valuetypes_endpoint): + async def test_dictionary_string_get(self, valuetypes_endpoint): client = self.create_async_client(endpoint=valuetypes_endpoint) response = await client.dictionary_string.get() @@ -24,7 +24,7 @@ async def test_get(self, valuetypes_endpoint): @ValueTypesPreparer() @recorded_by_proxy_async - async def test_put(self, valuetypes_endpoint): + async def test_dictionary_string_put(self, valuetypes_endpoint): client = self.create_async_client(endpoint=valuetypes_endpoint) response = await client.dictionary_string.put( body={"property": {"str": "str"}}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_duration_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_duration_operations.py index d1e66275c3c..135aa3cb772 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_duration_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_duration_operations.py @@ -14,7 +14,7 @@ class TestValueTypesDurationOperations(ValueTypesClientTestBase): @ValueTypesPreparer() @recorded_by_proxy - def test_get(self, valuetypes_endpoint): + def test_duration_get(self, valuetypes_endpoint): client = self.create_client(endpoint=valuetypes_endpoint) response = client.duration.get() @@ -23,7 +23,7 @@ def test_get(self, valuetypes_endpoint): @ValueTypesPreparer() @recorded_by_proxy - def test_put(self, valuetypes_endpoint): + def test_duration_put(self, valuetypes_endpoint): client = self.create_client(endpoint=valuetypes_endpoint) response = client.duration.put( body={"property": "1 day, 0:00:00"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_duration_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_duration_operations_async.py index c77fb4a51fd..cac800420e5 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_duration_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_duration_operations_async.py @@ -15,7 +15,7 @@ class TestValueTypesDurationOperationsAsync(ValueTypesClientTestBaseAsync): @ValueTypesPreparer() @recorded_by_proxy_async - async def test_get(self, valuetypes_endpoint): + async def test_duration_get(self, valuetypes_endpoint): client = self.create_async_client(endpoint=valuetypes_endpoint) response = await client.duration.get() @@ -24,7 +24,7 @@ async def test_get(self, valuetypes_endpoint): @ValueTypesPreparer() @recorded_by_proxy_async - async def test_put(self, valuetypes_endpoint): + async def test_duration_put(self, valuetypes_endpoint): client = self.create_async_client(endpoint=valuetypes_endpoint) response = await client.duration.put( body={"property": "1 day, 0:00:00"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_enum_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_enum_operations.py index 8eab7d452ba..cc503ad2394 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_enum_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_enum_operations.py @@ -14,7 +14,7 @@ class TestValueTypesEnumOperations(ValueTypesClientTestBase): @ValueTypesPreparer() @recorded_by_proxy - def test_get(self, valuetypes_endpoint): + def test_enum_get(self, valuetypes_endpoint): client = self.create_client(endpoint=valuetypes_endpoint) response = client.enum.get() @@ -23,7 +23,7 @@ def test_get(self, valuetypes_endpoint): @ValueTypesPreparer() @recorded_by_proxy - def test_put(self, valuetypes_endpoint): + def test_enum_put(self, valuetypes_endpoint): client = self.create_client(endpoint=valuetypes_endpoint) response = client.enum.put( body={"property": "str"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_enum_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_enum_operations_async.py index ab421656cf1..778528c75cf 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_enum_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_enum_operations_async.py @@ -15,7 +15,7 @@ class TestValueTypesEnumOperationsAsync(ValueTypesClientTestBaseAsync): @ValueTypesPreparer() @recorded_by_proxy_async - async def test_get(self, valuetypes_endpoint): + async def test_enum_get(self, valuetypes_endpoint): client = self.create_async_client(endpoint=valuetypes_endpoint) response = await client.enum.get() @@ -24,7 +24,7 @@ async def test_get(self, valuetypes_endpoint): @ValueTypesPreparer() @recorded_by_proxy_async - async def test_put(self, valuetypes_endpoint): + async def test_enum_put(self, valuetypes_endpoint): client = self.create_async_client(endpoint=valuetypes_endpoint) response = await client.enum.put( body={"property": "str"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_extensible_enum_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_extensible_enum_operations.py index a9731ea7887..a095e152b17 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_extensible_enum_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_extensible_enum_operations.py @@ -14,7 +14,7 @@ class TestValueTypesExtensibleEnumOperations(ValueTypesClientTestBase): @ValueTypesPreparer() @recorded_by_proxy - def test_get(self, valuetypes_endpoint): + def test_extensible_enum_get(self, valuetypes_endpoint): client = self.create_client(endpoint=valuetypes_endpoint) response = client.extensible_enum.get() @@ -23,7 +23,7 @@ def test_get(self, valuetypes_endpoint): @ValueTypesPreparer() @recorded_by_proxy - def test_put(self, valuetypes_endpoint): + def test_extensible_enum_put(self, valuetypes_endpoint): client = self.create_client(endpoint=valuetypes_endpoint) response = client.extensible_enum.put( body={"property": "str"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_extensible_enum_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_extensible_enum_operations_async.py index 4bbcd4039d5..362775ee153 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_extensible_enum_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_extensible_enum_operations_async.py @@ -15,7 +15,7 @@ class TestValueTypesExtensibleEnumOperationsAsync(ValueTypesClientTestBaseAsync): @ValueTypesPreparer() @recorded_by_proxy_async - async def test_get(self, valuetypes_endpoint): + async def test_extensible_enum_get(self, valuetypes_endpoint): client = self.create_async_client(endpoint=valuetypes_endpoint) response = await client.extensible_enum.get() @@ -24,7 +24,7 @@ async def test_get(self, valuetypes_endpoint): @ValueTypesPreparer() @recorded_by_proxy_async - async def test_put(self, valuetypes_endpoint): + async def test_extensible_enum_put(self, valuetypes_endpoint): client = self.create_async_client(endpoint=valuetypes_endpoint) response = await client.extensible_enum.put( body={"property": "str"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_float_literal_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_float_literal_operations.py index b7c1c8b01ea..df265bbaafc 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_float_literal_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_float_literal_operations.py @@ -14,7 +14,7 @@ class TestValueTypesFloatLiteralOperations(ValueTypesClientTestBase): @ValueTypesPreparer() @recorded_by_proxy - def test_get(self, valuetypes_endpoint): + def test_float_literal_get(self, valuetypes_endpoint): client = self.create_client(endpoint=valuetypes_endpoint) response = client.float_literal.get() @@ -23,7 +23,7 @@ def test_get(self, valuetypes_endpoint): @ValueTypesPreparer() @recorded_by_proxy - def test_put(self, valuetypes_endpoint): + def test_float_literal_put(self, valuetypes_endpoint): client = self.create_client(endpoint=valuetypes_endpoint) response = client.float_literal.put( body={"property": 43.125}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_float_literal_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_float_literal_operations_async.py index 64083631c5d..9bffccf770d 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_float_literal_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_float_literal_operations_async.py @@ -15,7 +15,7 @@ class TestValueTypesFloatLiteralOperationsAsync(ValueTypesClientTestBaseAsync): @ValueTypesPreparer() @recorded_by_proxy_async - async def test_get(self, valuetypes_endpoint): + async def test_float_literal_get(self, valuetypes_endpoint): client = self.create_async_client(endpoint=valuetypes_endpoint) response = await client.float_literal.get() @@ -24,7 +24,7 @@ async def test_get(self, valuetypes_endpoint): @ValueTypesPreparer() @recorded_by_proxy_async - async def test_put(self, valuetypes_endpoint): + async def test_float_literal_put(self, valuetypes_endpoint): client = self.create_async_client(endpoint=valuetypes_endpoint) response = await client.float_literal.put( body={"property": 43.125}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_float_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_float_operations.py index d4e2be97afe..b0fe9df2e81 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_float_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_float_operations.py @@ -14,7 +14,7 @@ class TestValueTypesFloatOperations(ValueTypesClientTestBase): @ValueTypesPreparer() @recorded_by_proxy - def test_get(self, valuetypes_endpoint): + def test_float_get(self, valuetypes_endpoint): client = self.create_client(endpoint=valuetypes_endpoint) response = client.float.get() @@ -23,7 +23,7 @@ def test_get(self, valuetypes_endpoint): @ValueTypesPreparer() @recorded_by_proxy - def test_put(self, valuetypes_endpoint): + def test_float_put(self, valuetypes_endpoint): client = self.create_client(endpoint=valuetypes_endpoint) response = client.float.put( body={"property": 0.0}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_float_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_float_operations_async.py index ef799eb94cb..18f8789a51f 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_float_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_float_operations_async.py @@ -15,7 +15,7 @@ class TestValueTypesFloatOperationsAsync(ValueTypesClientTestBaseAsync): @ValueTypesPreparer() @recorded_by_proxy_async - async def test_get(self, valuetypes_endpoint): + async def test_float_get(self, valuetypes_endpoint): client = self.create_async_client(endpoint=valuetypes_endpoint) response = await client.float.get() @@ -24,7 +24,7 @@ async def test_get(self, valuetypes_endpoint): @ValueTypesPreparer() @recorded_by_proxy_async - async def test_put(self, valuetypes_endpoint): + async def test_float_put(self, valuetypes_endpoint): client = self.create_async_client(endpoint=valuetypes_endpoint) response = await client.float.put( body={"property": 0.0}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_int_literal_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_int_literal_operations.py index ec024255c8d..061f04a21a5 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_int_literal_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_int_literal_operations.py @@ -14,7 +14,7 @@ class TestValueTypesIntLiteralOperations(ValueTypesClientTestBase): @ValueTypesPreparer() @recorded_by_proxy - def test_get(self, valuetypes_endpoint): + def test_int_literal_get(self, valuetypes_endpoint): client = self.create_client(endpoint=valuetypes_endpoint) response = client.int_literal.get() @@ -23,7 +23,7 @@ def test_get(self, valuetypes_endpoint): @ValueTypesPreparer() @recorded_by_proxy - def test_put(self, valuetypes_endpoint): + def test_int_literal_put(self, valuetypes_endpoint): client = self.create_client(endpoint=valuetypes_endpoint) response = client.int_literal.put( body={"property": 42}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_int_literal_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_int_literal_operations_async.py index 4e01a20b05a..46d4783f71f 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_int_literal_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_int_literal_operations_async.py @@ -15,7 +15,7 @@ class TestValueTypesIntLiteralOperationsAsync(ValueTypesClientTestBaseAsync): @ValueTypesPreparer() @recorded_by_proxy_async - async def test_get(self, valuetypes_endpoint): + async def test_int_literal_get(self, valuetypes_endpoint): client = self.create_async_client(endpoint=valuetypes_endpoint) response = await client.int_literal.get() @@ -24,7 +24,7 @@ async def test_get(self, valuetypes_endpoint): @ValueTypesPreparer() @recorded_by_proxy_async - async def test_put(self, valuetypes_endpoint): + async def test_int_literal_put(self, valuetypes_endpoint): client = self.create_async_client(endpoint=valuetypes_endpoint) response = await client.int_literal.put( body={"property": 42}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_int_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_int_operations.py index cef08f088c8..a59b36e06e1 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_int_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_int_operations.py @@ -14,7 +14,7 @@ class TestValueTypesIntOperations(ValueTypesClientTestBase): @ValueTypesPreparer() @recorded_by_proxy - def test_get(self, valuetypes_endpoint): + def test_int_operations_get(self, valuetypes_endpoint): client = self.create_client(endpoint=valuetypes_endpoint) response = client.int_operations.get() @@ -23,7 +23,7 @@ def test_get(self, valuetypes_endpoint): @ValueTypesPreparer() @recorded_by_proxy - def test_put(self, valuetypes_endpoint): + def test_int_operations_put(self, valuetypes_endpoint): client = self.create_client(endpoint=valuetypes_endpoint) response = client.int_operations.put( body={"property": 0}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_int_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_int_operations_async.py index f146ffabb38..c694b12be4d 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_int_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_int_operations_async.py @@ -15,7 +15,7 @@ class TestValueTypesIntOperationsAsync(ValueTypesClientTestBaseAsync): @ValueTypesPreparer() @recorded_by_proxy_async - async def test_get(self, valuetypes_endpoint): + async def test_int_operations_get(self, valuetypes_endpoint): client = self.create_async_client(endpoint=valuetypes_endpoint) response = await client.int_operations.get() @@ -24,7 +24,7 @@ async def test_get(self, valuetypes_endpoint): @ValueTypesPreparer() @recorded_by_proxy_async - async def test_put(self, valuetypes_endpoint): + async def test_int_operations_put(self, valuetypes_endpoint): client = self.create_async_client(endpoint=valuetypes_endpoint) response = await client.int_operations.put( body={"property": 0}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_model_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_model_operations.py index 44f7183f168..a65204abb54 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_model_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_model_operations.py @@ -14,7 +14,7 @@ class TestValueTypesModelOperations(ValueTypesClientTestBase): @ValueTypesPreparer() @recorded_by_proxy - def test_get(self, valuetypes_endpoint): + def test_model_get(self, valuetypes_endpoint): client = self.create_client(endpoint=valuetypes_endpoint) response = client.model.get() @@ -23,7 +23,7 @@ def test_get(self, valuetypes_endpoint): @ValueTypesPreparer() @recorded_by_proxy - def test_put(self, valuetypes_endpoint): + def test_model_put(self, valuetypes_endpoint): client = self.create_client(endpoint=valuetypes_endpoint) response = client.model.put( body={"property": {"property": "str"}}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_model_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_model_operations_async.py index 9e269a8f514..aa51c3983e5 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_model_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_model_operations_async.py @@ -15,7 +15,7 @@ class TestValueTypesModelOperationsAsync(ValueTypesClientTestBaseAsync): @ValueTypesPreparer() @recorded_by_proxy_async - async def test_get(self, valuetypes_endpoint): + async def test_model_get(self, valuetypes_endpoint): client = self.create_async_client(endpoint=valuetypes_endpoint) response = await client.model.get() @@ -24,7 +24,7 @@ async def test_get(self, valuetypes_endpoint): @ValueTypesPreparer() @recorded_by_proxy_async - async def test_put(self, valuetypes_endpoint): + async def test_model_put(self, valuetypes_endpoint): client = self.create_async_client(endpoint=valuetypes_endpoint) response = await client.model.put( body={"property": {"property": "str"}}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_never_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_never_operations.py index 34795c53e93..9271124511a 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_never_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_never_operations.py @@ -14,7 +14,7 @@ class TestValueTypesNeverOperations(ValueTypesClientTestBase): @ValueTypesPreparer() @recorded_by_proxy - def test_get(self, valuetypes_endpoint): + def test_never_get(self, valuetypes_endpoint): client = self.create_client(endpoint=valuetypes_endpoint) response = client.never.get() @@ -23,7 +23,7 @@ def test_get(self, valuetypes_endpoint): @ValueTypesPreparer() @recorded_by_proxy - def test_put(self, valuetypes_endpoint): + def test_never_put(self, valuetypes_endpoint): client = self.create_client(endpoint=valuetypes_endpoint) response = client.never.put( body={}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_never_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_never_operations_async.py index 651e210401c..3a5917baf1b 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_never_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_never_operations_async.py @@ -15,7 +15,7 @@ class TestValueTypesNeverOperationsAsync(ValueTypesClientTestBaseAsync): @ValueTypesPreparer() @recorded_by_proxy_async - async def test_get(self, valuetypes_endpoint): + async def test_never_get(self, valuetypes_endpoint): client = self.create_async_client(endpoint=valuetypes_endpoint) response = await client.never.get() @@ -24,7 +24,7 @@ async def test_get(self, valuetypes_endpoint): @ValueTypesPreparer() @recorded_by_proxy_async - async def test_put(self, valuetypes_endpoint): + async def test_never_put(self, valuetypes_endpoint): client = self.create_async_client(endpoint=valuetypes_endpoint) response = await client.never.put( body={}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_string_literal_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_string_literal_operations.py index 804c32e16ee..906cdcc0ec9 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_string_literal_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_string_literal_operations.py @@ -14,7 +14,7 @@ class TestValueTypesStringLiteralOperations(ValueTypesClientTestBase): @ValueTypesPreparer() @recorded_by_proxy - def test_get(self, valuetypes_endpoint): + def test_string_literal_get(self, valuetypes_endpoint): client = self.create_client(endpoint=valuetypes_endpoint) response = client.string_literal.get() @@ -23,7 +23,7 @@ def test_get(self, valuetypes_endpoint): @ValueTypesPreparer() @recorded_by_proxy - def test_put(self, valuetypes_endpoint): + def test_string_literal_put(self, valuetypes_endpoint): client = self.create_client(endpoint=valuetypes_endpoint) response = client.string_literal.put( body={"property": "hello"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_string_literal_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_string_literal_operations_async.py index ced06df45a9..40d3144d7f1 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_string_literal_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_string_literal_operations_async.py @@ -15,7 +15,7 @@ class TestValueTypesStringLiteralOperationsAsync(ValueTypesClientTestBaseAsync): @ValueTypesPreparer() @recorded_by_proxy_async - async def test_get(self, valuetypes_endpoint): + async def test_string_literal_get(self, valuetypes_endpoint): client = self.create_async_client(endpoint=valuetypes_endpoint) response = await client.string_literal.get() @@ -24,7 +24,7 @@ async def test_get(self, valuetypes_endpoint): @ValueTypesPreparer() @recorded_by_proxy_async - async def test_put(self, valuetypes_endpoint): + async def test_string_literal_put(self, valuetypes_endpoint): client = self.create_async_client(endpoint=valuetypes_endpoint) response = await client.string_literal.put( body={"property": "hello"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_string_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_string_operations.py index 3efaa0bb066..60cec79a37b 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_string_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_string_operations.py @@ -14,7 +14,7 @@ class TestValueTypesStringOperations(ValueTypesClientTestBase): @ValueTypesPreparer() @recorded_by_proxy - def test_get(self, valuetypes_endpoint): + def test_string_get(self, valuetypes_endpoint): client = self.create_client(endpoint=valuetypes_endpoint) response = client.string.get() @@ -23,7 +23,7 @@ def test_get(self, valuetypes_endpoint): @ValueTypesPreparer() @recorded_by_proxy - def test_put(self, valuetypes_endpoint): + def test_string_put(self, valuetypes_endpoint): client = self.create_client(endpoint=valuetypes_endpoint) response = client.string.put( body={"property": "str"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_string_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_string_operations_async.py index 17294ed7a75..4da3d00b3ff 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_string_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_string_operations_async.py @@ -15,7 +15,7 @@ class TestValueTypesStringOperationsAsync(ValueTypesClientTestBaseAsync): @ValueTypesPreparer() @recorded_by_proxy_async - async def test_get(self, valuetypes_endpoint): + async def test_string_get(self, valuetypes_endpoint): client = self.create_async_client(endpoint=valuetypes_endpoint) response = await client.string.get() @@ -24,7 +24,7 @@ async def test_get(self, valuetypes_endpoint): @ValueTypesPreparer() @recorded_by_proxy_async - async def test_put(self, valuetypes_endpoint): + async def test_string_put(self, valuetypes_endpoint): client = self.create_async_client(endpoint=valuetypes_endpoint) response = await client.string.put( body={"property": "str"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_union_enum_value_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_union_enum_value_operations.py index 73eefff181e..8f3ada270c8 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_union_enum_value_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_union_enum_value_operations.py @@ -14,7 +14,7 @@ class TestValueTypesUnionEnumValueOperations(ValueTypesClientTestBase): @ValueTypesPreparer() @recorded_by_proxy - def test_get(self, valuetypes_endpoint): + def test_union_enum_value_get(self, valuetypes_endpoint): client = self.create_client(endpoint=valuetypes_endpoint) response = client.union_enum_value.get() @@ -23,7 +23,7 @@ def test_get(self, valuetypes_endpoint): @ValueTypesPreparer() @recorded_by_proxy - def test_put(self, valuetypes_endpoint): + def test_union_enum_value_put(self, valuetypes_endpoint): client = self.create_client(endpoint=valuetypes_endpoint) response = client.union_enum_value.put( body={"property": "str"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_union_enum_value_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_union_enum_value_operations_async.py index 8f41e60dde8..356ae6028a7 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_union_enum_value_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_union_enum_value_operations_async.py @@ -15,7 +15,7 @@ class TestValueTypesUnionEnumValueOperationsAsync(ValueTypesClientTestBaseAsync): @ValueTypesPreparer() @recorded_by_proxy_async - async def test_get(self, valuetypes_endpoint): + async def test_union_enum_value_get(self, valuetypes_endpoint): client = self.create_async_client(endpoint=valuetypes_endpoint) response = await client.union_enum_value.get() @@ -24,7 +24,7 @@ async def test_get(self, valuetypes_endpoint): @ValueTypesPreparer() @recorded_by_proxy_async - async def test_put(self, valuetypes_endpoint): + async def test_union_enum_value_put(self, valuetypes_endpoint): client = self.create_async_client(endpoint=valuetypes_endpoint) response = await client.union_enum_value.put( body={"property": "str"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_union_float_literal_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_union_float_literal_operations.py index 81ec57d8801..014f408a041 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_union_float_literal_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_union_float_literal_operations.py @@ -14,7 +14,7 @@ class TestValueTypesUnionFloatLiteralOperations(ValueTypesClientTestBase): @ValueTypesPreparer() @recorded_by_proxy - def test_get(self, valuetypes_endpoint): + def test_union_float_literal_get(self, valuetypes_endpoint): client = self.create_client(endpoint=valuetypes_endpoint) response = client.union_float_literal.get() @@ -23,7 +23,7 @@ def test_get(self, valuetypes_endpoint): @ValueTypesPreparer() @recorded_by_proxy - def test_put(self, valuetypes_endpoint): + def test_union_float_literal_put(self, valuetypes_endpoint): client = self.create_client(endpoint=valuetypes_endpoint) response = client.union_float_literal.put( body={"property": 43.125}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_union_float_literal_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_union_float_literal_operations_async.py index 6ea7ccf6fc7..a9690ec570c 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_union_float_literal_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_union_float_literal_operations_async.py @@ -15,7 +15,7 @@ class TestValueTypesUnionFloatLiteralOperationsAsync(ValueTypesClientTestBaseAsync): @ValueTypesPreparer() @recorded_by_proxy_async - async def test_get(self, valuetypes_endpoint): + async def test_union_float_literal_get(self, valuetypes_endpoint): client = self.create_async_client(endpoint=valuetypes_endpoint) response = await client.union_float_literal.get() @@ -24,7 +24,7 @@ async def test_get(self, valuetypes_endpoint): @ValueTypesPreparer() @recorded_by_proxy_async - async def test_put(self, valuetypes_endpoint): + async def test_union_float_literal_put(self, valuetypes_endpoint): client = self.create_async_client(endpoint=valuetypes_endpoint) response = await client.union_float_literal.put( body={"property": 43.125}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_union_int_literal_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_union_int_literal_operations.py index 8e020ea8b48..5388367dd02 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_union_int_literal_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_union_int_literal_operations.py @@ -14,7 +14,7 @@ class TestValueTypesUnionIntLiteralOperations(ValueTypesClientTestBase): @ValueTypesPreparer() @recorded_by_proxy - def test_get(self, valuetypes_endpoint): + def test_union_int_literal_get(self, valuetypes_endpoint): client = self.create_client(endpoint=valuetypes_endpoint) response = client.union_int_literal.get() @@ -23,7 +23,7 @@ def test_get(self, valuetypes_endpoint): @ValueTypesPreparer() @recorded_by_proxy - def test_put(self, valuetypes_endpoint): + def test_union_int_literal_put(self, valuetypes_endpoint): client = self.create_client(endpoint=valuetypes_endpoint) response = client.union_int_literal.put( body={"property": 42}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_union_int_literal_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_union_int_literal_operations_async.py index d1df2cf4f4c..589cebfb201 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_union_int_literal_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_union_int_literal_operations_async.py @@ -15,7 +15,7 @@ class TestValueTypesUnionIntLiteralOperationsAsync(ValueTypesClientTestBaseAsync): @ValueTypesPreparer() @recorded_by_proxy_async - async def test_get(self, valuetypes_endpoint): + async def test_union_int_literal_get(self, valuetypes_endpoint): client = self.create_async_client(endpoint=valuetypes_endpoint) response = await client.union_int_literal.get() @@ -24,7 +24,7 @@ async def test_get(self, valuetypes_endpoint): @ValueTypesPreparer() @recorded_by_proxy_async - async def test_put(self, valuetypes_endpoint): + async def test_union_int_literal_put(self, valuetypes_endpoint): client = self.create_async_client(endpoint=valuetypes_endpoint) response = await client.union_int_literal.put( body={"property": 42}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_union_string_literal_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_union_string_literal_operations.py index dbed0f9187d..89f1206661e 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_union_string_literal_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_union_string_literal_operations.py @@ -14,7 +14,7 @@ class TestValueTypesUnionStringLiteralOperations(ValueTypesClientTestBase): @ValueTypesPreparer() @recorded_by_proxy - def test_get(self, valuetypes_endpoint): + def test_union_string_literal_get(self, valuetypes_endpoint): client = self.create_client(endpoint=valuetypes_endpoint) response = client.union_string_literal.get() @@ -23,7 +23,7 @@ def test_get(self, valuetypes_endpoint): @ValueTypesPreparer() @recorded_by_proxy - def test_put(self, valuetypes_endpoint): + def test_union_string_literal_put(self, valuetypes_endpoint): client = self.create_client(endpoint=valuetypes_endpoint) response = client.union_string_literal.put( body={"property": "hello"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_union_string_literal_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_union_string_literal_operations_async.py index df9400d2bf8..b1d0eeb1cea 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_union_string_literal_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_union_string_literal_operations_async.py @@ -15,7 +15,7 @@ class TestValueTypesUnionStringLiteralOperationsAsync(ValueTypesClientTestBaseAsync): @ValueTypesPreparer() @recorded_by_proxy_async - async def test_get(self, valuetypes_endpoint): + async def test_union_string_literal_get(self, valuetypes_endpoint): client = self.create_async_client(endpoint=valuetypes_endpoint) response = await client.union_string_literal.get() @@ -24,7 +24,7 @@ async def test_get(self, valuetypes_endpoint): @ValueTypesPreparer() @recorded_by_proxy_async - async def test_put(self, valuetypes_endpoint): + async def test_union_string_literal_put(self, valuetypes_endpoint): client = self.create_async_client(endpoint=valuetypes_endpoint) response = await client.union_string_literal.put( body={"property": "hello"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_unknown_array_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_unknown_array_operations.py index 15df9f403e7..328bdaea272 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_unknown_array_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_unknown_array_operations.py @@ -14,7 +14,7 @@ class TestValueTypesUnknownArrayOperations(ValueTypesClientTestBase): @ValueTypesPreparer() @recorded_by_proxy - def test_get(self, valuetypes_endpoint): + def test_unknown_array_get(self, valuetypes_endpoint): client = self.create_client(endpoint=valuetypes_endpoint) response = client.unknown_array.get() @@ -23,7 +23,7 @@ def test_get(self, valuetypes_endpoint): @ValueTypesPreparer() @recorded_by_proxy - def test_put(self, valuetypes_endpoint): + def test_unknown_array_put(self, valuetypes_endpoint): client = self.create_client(endpoint=valuetypes_endpoint) response = client.unknown_array.put( body={"property": {}}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_unknown_array_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_unknown_array_operations_async.py index 43342cd21f3..7fcf40b5904 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_unknown_array_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_unknown_array_operations_async.py @@ -15,7 +15,7 @@ class TestValueTypesUnknownArrayOperationsAsync(ValueTypesClientTestBaseAsync): @ValueTypesPreparer() @recorded_by_proxy_async - async def test_get(self, valuetypes_endpoint): + async def test_unknown_array_get(self, valuetypes_endpoint): client = self.create_async_client(endpoint=valuetypes_endpoint) response = await client.unknown_array.get() @@ -24,7 +24,7 @@ async def test_get(self, valuetypes_endpoint): @ValueTypesPreparer() @recorded_by_proxy_async - async def test_put(self, valuetypes_endpoint): + async def test_unknown_array_put(self, valuetypes_endpoint): client = self.create_async_client(endpoint=valuetypes_endpoint) response = await client.unknown_array.put( body={"property": {}}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_unknown_dict_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_unknown_dict_operations.py index 41988118d11..f1f1b2d139f 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_unknown_dict_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_unknown_dict_operations.py @@ -14,7 +14,7 @@ class TestValueTypesUnknownDictOperations(ValueTypesClientTestBase): @ValueTypesPreparer() @recorded_by_proxy - def test_get(self, valuetypes_endpoint): + def test_unknown_dict_get(self, valuetypes_endpoint): client = self.create_client(endpoint=valuetypes_endpoint) response = client.unknown_dict.get() @@ -23,7 +23,7 @@ def test_get(self, valuetypes_endpoint): @ValueTypesPreparer() @recorded_by_proxy - def test_put(self, valuetypes_endpoint): + def test_unknown_dict_put(self, valuetypes_endpoint): client = self.create_client(endpoint=valuetypes_endpoint) response = client.unknown_dict.put( body={"property": {}}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_unknown_dict_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_unknown_dict_operations_async.py index 3ec379b4e22..d43b1a5e594 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_unknown_dict_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_unknown_dict_operations_async.py @@ -15,7 +15,7 @@ class TestValueTypesUnknownDictOperationsAsync(ValueTypesClientTestBaseAsync): @ValueTypesPreparer() @recorded_by_proxy_async - async def test_get(self, valuetypes_endpoint): + async def test_unknown_dict_get(self, valuetypes_endpoint): client = self.create_async_client(endpoint=valuetypes_endpoint) response = await client.unknown_dict.get() @@ -24,7 +24,7 @@ async def test_get(self, valuetypes_endpoint): @ValueTypesPreparer() @recorded_by_proxy_async - async def test_put(self, valuetypes_endpoint): + async def test_unknown_dict_put(self, valuetypes_endpoint): client = self.create_async_client(endpoint=valuetypes_endpoint) response = await client.unknown_dict.put( body={"property": {}}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_unknown_int_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_unknown_int_operations.py index 5219a8e9917..1fd3a8f292b 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_unknown_int_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_unknown_int_operations.py @@ -14,7 +14,7 @@ class TestValueTypesUnknownIntOperations(ValueTypesClientTestBase): @ValueTypesPreparer() @recorded_by_proxy - def test_get(self, valuetypes_endpoint): + def test_unknown_int_get(self, valuetypes_endpoint): client = self.create_client(endpoint=valuetypes_endpoint) response = client.unknown_int.get() @@ -23,7 +23,7 @@ def test_get(self, valuetypes_endpoint): @ValueTypesPreparer() @recorded_by_proxy - def test_put(self, valuetypes_endpoint): + def test_unknown_int_put(self, valuetypes_endpoint): client = self.create_client(endpoint=valuetypes_endpoint) response = client.unknown_int.put( body={"property": {}}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_unknown_int_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_unknown_int_operations_async.py index 370c1b68b12..688cf49172d 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_unknown_int_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_unknown_int_operations_async.py @@ -15,7 +15,7 @@ class TestValueTypesUnknownIntOperationsAsync(ValueTypesClientTestBaseAsync): @ValueTypesPreparer() @recorded_by_proxy_async - async def test_get(self, valuetypes_endpoint): + async def test_unknown_int_get(self, valuetypes_endpoint): client = self.create_async_client(endpoint=valuetypes_endpoint) response = await client.unknown_int.get() @@ -24,7 +24,7 @@ async def test_get(self, valuetypes_endpoint): @ValueTypesPreparer() @recorded_by_proxy_async - async def test_put(self, valuetypes_endpoint): + async def test_unknown_int_put(self, valuetypes_endpoint): client = self.create_async_client(endpoint=valuetypes_endpoint) response = await client.unknown_int.put( body={"property": {}}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_unknown_string_operations.py b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_unknown_string_operations.py index 8ec77ffccda..de51f421a4f 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_unknown_string_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_unknown_string_operations.py @@ -14,7 +14,7 @@ class TestValueTypesUnknownStringOperations(ValueTypesClientTestBase): @ValueTypesPreparer() @recorded_by_proxy - def test_get(self, valuetypes_endpoint): + def test_unknown_string_get(self, valuetypes_endpoint): client = self.create_client(endpoint=valuetypes_endpoint) response = client.unknown_string.get() @@ -23,7 +23,7 @@ def test_get(self, valuetypes_endpoint): @ValueTypesPreparer() @recorded_by_proxy - def test_put(self, valuetypes_endpoint): + def test_unknown_string_put(self, valuetypes_endpoint): client = self.create_client(endpoint=valuetypes_endpoint) response = client.unknown_string.put( body={"property": {}}, diff --git a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_unknown_string_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_unknown_string_operations_async.py index 30b343094dc..4c60198bcef 100644 --- a/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_unknown_string_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-property-valuetypes/generated_tests/test_value_types_unknown_string_operations_async.py @@ -15,7 +15,7 @@ class TestValueTypesUnknownStringOperationsAsync(ValueTypesClientTestBaseAsync): @ValueTypesPreparer() @recorded_by_proxy_async - async def test_get(self, valuetypes_endpoint): + async def test_unknown_string_get(self, valuetypes_endpoint): client = self.create_async_client(endpoint=valuetypes_endpoint) response = await client.unknown_string.get() @@ -24,7 +24,7 @@ async def test_get(self, valuetypes_endpoint): @ValueTypesPreparer() @recorded_by_proxy_async - async def test_put(self, valuetypes_endpoint): + async def test_unknown_string_put(self, valuetypes_endpoint): client = self.create_async_client(endpoint=valuetypes_endpoint) response = await client.unknown_string.put( body={"property": {}}, diff --git a/packages/typespec-python/test/azure/generated/typetest-scalar/generated_tests/test_scalar_boolean_operations.py b/packages/typespec-python/test/azure/generated/typetest-scalar/generated_tests/test_scalar_boolean_operations.py index f60395ae17a..8ed568688c1 100644 --- a/packages/typespec-python/test/azure/generated/typetest-scalar/generated_tests/test_scalar_boolean_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-scalar/generated_tests/test_scalar_boolean_operations.py @@ -14,7 +14,7 @@ class TestScalarBooleanOperations(ScalarClientTestBase): @ScalarPreparer() @recorded_by_proxy - def test_get(self, scalar_endpoint): + def test_boolean_get(self, scalar_endpoint): client = self.create_client(endpoint=scalar_endpoint) response = client.boolean.get() @@ -23,7 +23,7 @@ def test_get(self, scalar_endpoint): @ScalarPreparer() @recorded_by_proxy - def test_put(self, scalar_endpoint): + def test_boolean_put(self, scalar_endpoint): client = self.create_client(endpoint=scalar_endpoint) response = client.boolean.put( body=bool, diff --git a/packages/typespec-python/test/azure/generated/typetest-scalar/generated_tests/test_scalar_boolean_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-scalar/generated_tests/test_scalar_boolean_operations_async.py index ebcc2cbd962..beb9b7ee726 100644 --- a/packages/typespec-python/test/azure/generated/typetest-scalar/generated_tests/test_scalar_boolean_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-scalar/generated_tests/test_scalar_boolean_operations_async.py @@ -15,7 +15,7 @@ class TestScalarBooleanOperationsAsync(ScalarClientTestBaseAsync): @ScalarPreparer() @recorded_by_proxy_async - async def test_get(self, scalar_endpoint): + async def test_boolean_get(self, scalar_endpoint): client = self.create_async_client(endpoint=scalar_endpoint) response = await client.boolean.get() @@ -24,7 +24,7 @@ async def test_get(self, scalar_endpoint): @ScalarPreparer() @recorded_by_proxy_async - async def test_put(self, scalar_endpoint): + async def test_boolean_put(self, scalar_endpoint): client = self.create_async_client(endpoint=scalar_endpoint) response = await client.boolean.put( body=bool, diff --git a/packages/typespec-python/test/azure/generated/typetest-scalar/generated_tests/test_scalar_decimal128_type_operations.py b/packages/typespec-python/test/azure/generated/typetest-scalar/generated_tests/test_scalar_decimal128_type_operations.py index f8ab07be649..a66b1a98438 100644 --- a/packages/typespec-python/test/azure/generated/typetest-scalar/generated_tests/test_scalar_decimal128_type_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-scalar/generated_tests/test_scalar_decimal128_type_operations.py @@ -14,7 +14,7 @@ class TestScalarDecimal128TypeOperations(ScalarClientTestBase): @ScalarPreparer() @recorded_by_proxy - def test_response_body(self, scalar_endpoint): + def test_decimal128_type_response_body(self, scalar_endpoint): client = self.create_client(endpoint=scalar_endpoint) response = client.decimal128_type.response_body() @@ -23,7 +23,7 @@ def test_response_body(self, scalar_endpoint): @ScalarPreparer() @recorded_by_proxy - def test_request_body(self, scalar_endpoint): + def test_decimal128_type_request_body(self, scalar_endpoint): client = self.create_client(endpoint=scalar_endpoint) response = client.decimal128_type.request_body( body=0.0, @@ -35,7 +35,7 @@ def test_request_body(self, scalar_endpoint): @ScalarPreparer() @recorded_by_proxy - def test_request_parameter(self, scalar_endpoint): + def test_decimal128_type_request_parameter(self, scalar_endpoint): client = self.create_client(endpoint=scalar_endpoint) response = client.decimal128_type.request_parameter( value=0.0, diff --git a/packages/typespec-python/test/azure/generated/typetest-scalar/generated_tests/test_scalar_decimal128_type_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-scalar/generated_tests/test_scalar_decimal128_type_operations_async.py index 12dd93c8b93..8d30937e1da 100644 --- a/packages/typespec-python/test/azure/generated/typetest-scalar/generated_tests/test_scalar_decimal128_type_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-scalar/generated_tests/test_scalar_decimal128_type_operations_async.py @@ -15,7 +15,7 @@ class TestScalarDecimal128TypeOperationsAsync(ScalarClientTestBaseAsync): @ScalarPreparer() @recorded_by_proxy_async - async def test_response_body(self, scalar_endpoint): + async def test_decimal128_type_response_body(self, scalar_endpoint): client = self.create_async_client(endpoint=scalar_endpoint) response = await client.decimal128_type.response_body() @@ -24,7 +24,7 @@ async def test_response_body(self, scalar_endpoint): @ScalarPreparer() @recorded_by_proxy_async - async def test_request_body(self, scalar_endpoint): + async def test_decimal128_type_request_body(self, scalar_endpoint): client = self.create_async_client(endpoint=scalar_endpoint) response = await client.decimal128_type.request_body( body=0.0, @@ -36,7 +36,7 @@ async def test_request_body(self, scalar_endpoint): @ScalarPreparer() @recorded_by_proxy_async - async def test_request_parameter(self, scalar_endpoint): + async def test_decimal128_type_request_parameter(self, scalar_endpoint): client = self.create_async_client(endpoint=scalar_endpoint) response = await client.decimal128_type.request_parameter( value=0.0, diff --git a/packages/typespec-python/test/azure/generated/typetest-scalar/generated_tests/test_scalar_decimal128_verify_operations.py b/packages/typespec-python/test/azure/generated/typetest-scalar/generated_tests/test_scalar_decimal128_verify_operations.py index e0cdeade71f..575d594f1da 100644 --- a/packages/typespec-python/test/azure/generated/typetest-scalar/generated_tests/test_scalar_decimal128_verify_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-scalar/generated_tests/test_scalar_decimal128_verify_operations.py @@ -14,7 +14,7 @@ class TestScalarDecimal128VerifyOperations(ScalarClientTestBase): @ScalarPreparer() @recorded_by_proxy - def test_prepare_verify(self, scalar_endpoint): + def test_decimal128_verify_prepare_verify(self, scalar_endpoint): client = self.create_client(endpoint=scalar_endpoint) response = client.decimal128_verify.prepare_verify() @@ -23,7 +23,7 @@ def test_prepare_verify(self, scalar_endpoint): @ScalarPreparer() @recorded_by_proxy - def test_verify(self, scalar_endpoint): + def test_decimal128_verify_verify(self, scalar_endpoint): client = self.create_client(endpoint=scalar_endpoint) response = client.decimal128_verify.verify( body=0.0, diff --git a/packages/typespec-python/test/azure/generated/typetest-scalar/generated_tests/test_scalar_decimal128_verify_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-scalar/generated_tests/test_scalar_decimal128_verify_operations_async.py index a0b5a816855..c8a29772379 100644 --- a/packages/typespec-python/test/azure/generated/typetest-scalar/generated_tests/test_scalar_decimal128_verify_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-scalar/generated_tests/test_scalar_decimal128_verify_operations_async.py @@ -15,7 +15,7 @@ class TestScalarDecimal128VerifyOperationsAsync(ScalarClientTestBaseAsync): @ScalarPreparer() @recorded_by_proxy_async - async def test_prepare_verify(self, scalar_endpoint): + async def test_decimal128_verify_prepare_verify(self, scalar_endpoint): client = self.create_async_client(endpoint=scalar_endpoint) response = await client.decimal128_verify.prepare_verify() @@ -24,7 +24,7 @@ async def test_prepare_verify(self, scalar_endpoint): @ScalarPreparer() @recorded_by_proxy_async - async def test_verify(self, scalar_endpoint): + async def test_decimal128_verify_verify(self, scalar_endpoint): client = self.create_async_client(endpoint=scalar_endpoint) response = await client.decimal128_verify.verify( body=0.0, diff --git a/packages/typespec-python/test/azure/generated/typetest-scalar/generated_tests/test_scalar_decimal_type_operations.py b/packages/typespec-python/test/azure/generated/typetest-scalar/generated_tests/test_scalar_decimal_type_operations.py index 6cb7ba04456..744251a8c93 100644 --- a/packages/typespec-python/test/azure/generated/typetest-scalar/generated_tests/test_scalar_decimal_type_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-scalar/generated_tests/test_scalar_decimal_type_operations.py @@ -14,7 +14,7 @@ class TestScalarDecimalTypeOperations(ScalarClientTestBase): @ScalarPreparer() @recorded_by_proxy - def test_response_body(self, scalar_endpoint): + def test_decimal_type_response_body(self, scalar_endpoint): client = self.create_client(endpoint=scalar_endpoint) response = client.decimal_type.response_body() @@ -23,7 +23,7 @@ def test_response_body(self, scalar_endpoint): @ScalarPreparer() @recorded_by_proxy - def test_request_body(self, scalar_endpoint): + def test_decimal_type_request_body(self, scalar_endpoint): client = self.create_client(endpoint=scalar_endpoint) response = client.decimal_type.request_body( body=0.0, @@ -35,7 +35,7 @@ def test_request_body(self, scalar_endpoint): @ScalarPreparer() @recorded_by_proxy - def test_request_parameter(self, scalar_endpoint): + def test_decimal_type_request_parameter(self, scalar_endpoint): client = self.create_client(endpoint=scalar_endpoint) response = client.decimal_type.request_parameter( value=0.0, diff --git a/packages/typespec-python/test/azure/generated/typetest-scalar/generated_tests/test_scalar_decimal_type_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-scalar/generated_tests/test_scalar_decimal_type_operations_async.py index d4b27f63647..8ceb3f201ac 100644 --- a/packages/typespec-python/test/azure/generated/typetest-scalar/generated_tests/test_scalar_decimal_type_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-scalar/generated_tests/test_scalar_decimal_type_operations_async.py @@ -15,7 +15,7 @@ class TestScalarDecimalTypeOperationsAsync(ScalarClientTestBaseAsync): @ScalarPreparer() @recorded_by_proxy_async - async def test_response_body(self, scalar_endpoint): + async def test_decimal_type_response_body(self, scalar_endpoint): client = self.create_async_client(endpoint=scalar_endpoint) response = await client.decimal_type.response_body() @@ -24,7 +24,7 @@ async def test_response_body(self, scalar_endpoint): @ScalarPreparer() @recorded_by_proxy_async - async def test_request_body(self, scalar_endpoint): + async def test_decimal_type_request_body(self, scalar_endpoint): client = self.create_async_client(endpoint=scalar_endpoint) response = await client.decimal_type.request_body( body=0.0, @@ -36,7 +36,7 @@ async def test_request_body(self, scalar_endpoint): @ScalarPreparer() @recorded_by_proxy_async - async def test_request_parameter(self, scalar_endpoint): + async def test_decimal_type_request_parameter(self, scalar_endpoint): client = self.create_async_client(endpoint=scalar_endpoint) response = await client.decimal_type.request_parameter( value=0.0, diff --git a/packages/typespec-python/test/azure/generated/typetest-scalar/generated_tests/test_scalar_decimal_verify_operations.py b/packages/typespec-python/test/azure/generated/typetest-scalar/generated_tests/test_scalar_decimal_verify_operations.py index 877565212d2..4b4b954a380 100644 --- a/packages/typespec-python/test/azure/generated/typetest-scalar/generated_tests/test_scalar_decimal_verify_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-scalar/generated_tests/test_scalar_decimal_verify_operations.py @@ -14,7 +14,7 @@ class TestScalarDecimalVerifyOperations(ScalarClientTestBase): @ScalarPreparer() @recorded_by_proxy - def test_prepare_verify(self, scalar_endpoint): + def test_decimal_verify_prepare_verify(self, scalar_endpoint): client = self.create_client(endpoint=scalar_endpoint) response = client.decimal_verify.prepare_verify() @@ -23,7 +23,7 @@ def test_prepare_verify(self, scalar_endpoint): @ScalarPreparer() @recorded_by_proxy - def test_verify(self, scalar_endpoint): + def test_decimal_verify_verify(self, scalar_endpoint): client = self.create_client(endpoint=scalar_endpoint) response = client.decimal_verify.verify( body=0.0, diff --git a/packages/typespec-python/test/azure/generated/typetest-scalar/generated_tests/test_scalar_decimal_verify_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-scalar/generated_tests/test_scalar_decimal_verify_operations_async.py index 7903140f969..0d649c9cdec 100644 --- a/packages/typespec-python/test/azure/generated/typetest-scalar/generated_tests/test_scalar_decimal_verify_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-scalar/generated_tests/test_scalar_decimal_verify_operations_async.py @@ -15,7 +15,7 @@ class TestScalarDecimalVerifyOperationsAsync(ScalarClientTestBaseAsync): @ScalarPreparer() @recorded_by_proxy_async - async def test_prepare_verify(self, scalar_endpoint): + async def test_decimal_verify_prepare_verify(self, scalar_endpoint): client = self.create_async_client(endpoint=scalar_endpoint) response = await client.decimal_verify.prepare_verify() @@ -24,7 +24,7 @@ async def test_prepare_verify(self, scalar_endpoint): @ScalarPreparer() @recorded_by_proxy_async - async def test_verify(self, scalar_endpoint): + async def test_decimal_verify_verify(self, scalar_endpoint): client = self.create_async_client(endpoint=scalar_endpoint) response = await client.decimal_verify.verify( body=0.0, diff --git a/packages/typespec-python/test/azure/generated/typetest-scalar/generated_tests/test_scalar_string_operations.py b/packages/typespec-python/test/azure/generated/typetest-scalar/generated_tests/test_scalar_string_operations.py index b3136dea11f..951f291fca6 100644 --- a/packages/typespec-python/test/azure/generated/typetest-scalar/generated_tests/test_scalar_string_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-scalar/generated_tests/test_scalar_string_operations.py @@ -14,7 +14,7 @@ class TestScalarStringOperations(ScalarClientTestBase): @ScalarPreparer() @recorded_by_proxy - def test_get(self, scalar_endpoint): + def test_string_get(self, scalar_endpoint): client = self.create_client(endpoint=scalar_endpoint) response = client.string.get() @@ -23,7 +23,7 @@ def test_get(self, scalar_endpoint): @ScalarPreparer() @recorded_by_proxy - def test_put(self, scalar_endpoint): + def test_string_put(self, scalar_endpoint): client = self.create_client(endpoint=scalar_endpoint) response = client.string.put( body="str", diff --git a/packages/typespec-python/test/azure/generated/typetest-scalar/generated_tests/test_scalar_string_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-scalar/generated_tests/test_scalar_string_operations_async.py index 662e3a543d3..03824836948 100644 --- a/packages/typespec-python/test/azure/generated/typetest-scalar/generated_tests/test_scalar_string_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-scalar/generated_tests/test_scalar_string_operations_async.py @@ -15,7 +15,7 @@ class TestScalarStringOperationsAsync(ScalarClientTestBaseAsync): @ScalarPreparer() @recorded_by_proxy_async - async def test_get(self, scalar_endpoint): + async def test_string_get(self, scalar_endpoint): client = self.create_async_client(endpoint=scalar_endpoint) response = await client.string.get() @@ -24,7 +24,7 @@ async def test_get(self, scalar_endpoint): @ScalarPreparer() @recorded_by_proxy_async - async def test_put(self, scalar_endpoint): + async def test_string_put(self, scalar_endpoint): client = self.create_async_client(endpoint=scalar_endpoint) response = await client.string.put( body="str", diff --git a/packages/typespec-python/test/azure/generated/typetest-scalar/generated_tests/test_scalar_unknown_operations.py b/packages/typespec-python/test/azure/generated/typetest-scalar/generated_tests/test_scalar_unknown_operations.py index cd87515ac2c..9af0d808bc9 100644 --- a/packages/typespec-python/test/azure/generated/typetest-scalar/generated_tests/test_scalar_unknown_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-scalar/generated_tests/test_scalar_unknown_operations.py @@ -14,7 +14,7 @@ class TestScalarUnknownOperations(ScalarClientTestBase): @ScalarPreparer() @recorded_by_proxy - def test_get(self, scalar_endpoint): + def test_unknown_get(self, scalar_endpoint): client = self.create_client(endpoint=scalar_endpoint) response = client.unknown.get() @@ -23,7 +23,7 @@ def test_get(self, scalar_endpoint): @ScalarPreparer() @recorded_by_proxy - def test_put(self, scalar_endpoint): + def test_unknown_put(self, scalar_endpoint): client = self.create_client(endpoint=scalar_endpoint) response = client.unknown.put( body={}, diff --git a/packages/typespec-python/test/azure/generated/typetest-scalar/generated_tests/test_scalar_unknown_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-scalar/generated_tests/test_scalar_unknown_operations_async.py index 11cb6a4ccb2..fd3aa53ac1b 100644 --- a/packages/typespec-python/test/azure/generated/typetest-scalar/generated_tests/test_scalar_unknown_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-scalar/generated_tests/test_scalar_unknown_operations_async.py @@ -15,7 +15,7 @@ class TestScalarUnknownOperationsAsync(ScalarClientTestBaseAsync): @ScalarPreparer() @recorded_by_proxy_async - async def test_get(self, scalar_endpoint): + async def test_unknown_get(self, scalar_endpoint): client = self.create_async_client(endpoint=scalar_endpoint) response = await client.unknown.get() @@ -24,7 +24,7 @@ async def test_get(self, scalar_endpoint): @ScalarPreparer() @recorded_by_proxy_async - async def test_put(self, scalar_endpoint): + async def test_unknown_put(self, scalar_endpoint): client = self.create_async_client(endpoint=scalar_endpoint) response = await client.unknown.put( body={}, diff --git a/packages/typespec-python/test/azure/generated/typetest-union/generated_tests/test_union_enums_only_operations.py b/packages/typespec-python/test/azure/generated/typetest-union/generated_tests/test_union_enums_only_operations.py index b1064bc9dc7..e35f531e7af 100644 --- a/packages/typespec-python/test/azure/generated/typetest-union/generated_tests/test_union_enums_only_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-union/generated_tests/test_union_enums_only_operations.py @@ -14,7 +14,7 @@ class TestUnionEnumsOnlyOperations(UnionClientTestBase): @UnionPreparer() @recorded_by_proxy - def test_get(self, union_endpoint): + def test_enums_only_get(self, union_endpoint): client = self.create_client(endpoint=union_endpoint) response = client.enums_only.get() @@ -23,7 +23,7 @@ def test_get(self, union_endpoint): @UnionPreparer() @recorded_by_proxy - def test_send(self, union_endpoint): + def test_enums_only_send(self, union_endpoint): client = self.create_client(endpoint=union_endpoint) response = client.enums_only.send( body={"prop": {"lr": "left", "ud": "up"}}, diff --git a/packages/typespec-python/test/azure/generated/typetest-union/generated_tests/test_union_enums_only_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-union/generated_tests/test_union_enums_only_operations_async.py index 5f1aaf41e94..7927950425b 100644 --- a/packages/typespec-python/test/azure/generated/typetest-union/generated_tests/test_union_enums_only_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-union/generated_tests/test_union_enums_only_operations_async.py @@ -15,7 +15,7 @@ class TestUnionEnumsOnlyOperationsAsync(UnionClientTestBaseAsync): @UnionPreparer() @recorded_by_proxy_async - async def test_get(self, union_endpoint): + async def test_enums_only_get(self, union_endpoint): client = self.create_async_client(endpoint=union_endpoint) response = await client.enums_only.get() @@ -24,7 +24,7 @@ async def test_get(self, union_endpoint): @UnionPreparer() @recorded_by_proxy_async - async def test_send(self, union_endpoint): + async def test_enums_only_send(self, union_endpoint): client = self.create_async_client(endpoint=union_endpoint) response = await client.enums_only.send( body={"prop": {"lr": "left", "ud": "up"}}, diff --git a/packages/typespec-python/test/azure/generated/typetest-union/generated_tests/test_union_floats_only_operations.py b/packages/typespec-python/test/azure/generated/typetest-union/generated_tests/test_union_floats_only_operations.py index c1bf2f15f06..1f6b8c84fc7 100644 --- a/packages/typespec-python/test/azure/generated/typetest-union/generated_tests/test_union_floats_only_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-union/generated_tests/test_union_floats_only_operations.py @@ -14,7 +14,7 @@ class TestUnionFloatsOnlyOperations(UnionClientTestBase): @UnionPreparer() @recorded_by_proxy - def test_get(self, union_endpoint): + def test_floats_only_get(self, union_endpoint): client = self.create_client(endpoint=union_endpoint) response = client.floats_only.get() @@ -23,7 +23,7 @@ def test_get(self, union_endpoint): @UnionPreparer() @recorded_by_proxy - def test_send(self, union_endpoint): + def test_floats_only_send(self, union_endpoint): client = self.create_client(endpoint=union_endpoint) response = client.floats_only.send( body={"prop": 1.1}, diff --git a/packages/typespec-python/test/azure/generated/typetest-union/generated_tests/test_union_floats_only_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-union/generated_tests/test_union_floats_only_operations_async.py index 1d2a54e4fae..95c162de097 100644 --- a/packages/typespec-python/test/azure/generated/typetest-union/generated_tests/test_union_floats_only_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-union/generated_tests/test_union_floats_only_operations_async.py @@ -15,7 +15,7 @@ class TestUnionFloatsOnlyOperationsAsync(UnionClientTestBaseAsync): @UnionPreparer() @recorded_by_proxy_async - async def test_get(self, union_endpoint): + async def test_floats_only_get(self, union_endpoint): client = self.create_async_client(endpoint=union_endpoint) response = await client.floats_only.get() @@ -24,7 +24,7 @@ async def test_get(self, union_endpoint): @UnionPreparer() @recorded_by_proxy_async - async def test_send(self, union_endpoint): + async def test_floats_only_send(self, union_endpoint): client = self.create_async_client(endpoint=union_endpoint) response = await client.floats_only.send( body={"prop": 1.1}, diff --git a/packages/typespec-python/test/azure/generated/typetest-union/generated_tests/test_union_ints_only_operations.py b/packages/typespec-python/test/azure/generated/typetest-union/generated_tests/test_union_ints_only_operations.py index f5757962f26..8eb6efc6d13 100644 --- a/packages/typespec-python/test/azure/generated/typetest-union/generated_tests/test_union_ints_only_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-union/generated_tests/test_union_ints_only_operations.py @@ -14,7 +14,7 @@ class TestUnionIntsOnlyOperations(UnionClientTestBase): @UnionPreparer() @recorded_by_proxy - def test_get(self, union_endpoint): + def test_ints_only_get(self, union_endpoint): client = self.create_client(endpoint=union_endpoint) response = client.ints_only.get() @@ -23,7 +23,7 @@ def test_get(self, union_endpoint): @UnionPreparer() @recorded_by_proxy - def test_send(self, union_endpoint): + def test_ints_only_send(self, union_endpoint): client = self.create_client(endpoint=union_endpoint) response = client.ints_only.send( body={"prop": 1}, diff --git a/packages/typespec-python/test/azure/generated/typetest-union/generated_tests/test_union_ints_only_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-union/generated_tests/test_union_ints_only_operations_async.py index 280569a7bf9..876727cdc0c 100644 --- a/packages/typespec-python/test/azure/generated/typetest-union/generated_tests/test_union_ints_only_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-union/generated_tests/test_union_ints_only_operations_async.py @@ -15,7 +15,7 @@ class TestUnionIntsOnlyOperationsAsync(UnionClientTestBaseAsync): @UnionPreparer() @recorded_by_proxy_async - async def test_get(self, union_endpoint): + async def test_ints_only_get(self, union_endpoint): client = self.create_async_client(endpoint=union_endpoint) response = await client.ints_only.get() @@ -24,7 +24,7 @@ async def test_get(self, union_endpoint): @UnionPreparer() @recorded_by_proxy_async - async def test_send(self, union_endpoint): + async def test_ints_only_send(self, union_endpoint): client = self.create_async_client(endpoint=union_endpoint) response = await client.ints_only.send( body={"prop": 1}, diff --git a/packages/typespec-python/test/azure/generated/typetest-union/generated_tests/test_union_mixed_literals_operations.py b/packages/typespec-python/test/azure/generated/typetest-union/generated_tests/test_union_mixed_literals_operations.py index 3b6af6eccc7..2b46b3270d9 100644 --- a/packages/typespec-python/test/azure/generated/typetest-union/generated_tests/test_union_mixed_literals_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-union/generated_tests/test_union_mixed_literals_operations.py @@ -14,7 +14,7 @@ class TestUnionMixedLiteralsOperations(UnionClientTestBase): @UnionPreparer() @recorded_by_proxy - def test_get(self, union_endpoint): + def test_mixed_literals_get(self, union_endpoint): client = self.create_client(endpoint=union_endpoint) response = client.mixed_literals.get() @@ -23,7 +23,7 @@ def test_get(self, union_endpoint): @UnionPreparer() @recorded_by_proxy - def test_send(self, union_endpoint): + def test_mixed_literals_send(self, union_endpoint): client = self.create_client(endpoint=union_endpoint) response = client.mixed_literals.send( body={"prop": {"booleanLiteral": "a", "floatLiteral": "a", "intLiteral": "a", "stringLiteral": "a"}}, diff --git a/packages/typespec-python/test/azure/generated/typetest-union/generated_tests/test_union_mixed_literals_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-union/generated_tests/test_union_mixed_literals_operations_async.py index ecccf37df7f..356f7496bf0 100644 --- a/packages/typespec-python/test/azure/generated/typetest-union/generated_tests/test_union_mixed_literals_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-union/generated_tests/test_union_mixed_literals_operations_async.py @@ -15,7 +15,7 @@ class TestUnionMixedLiteralsOperationsAsync(UnionClientTestBaseAsync): @UnionPreparer() @recorded_by_proxy_async - async def test_get(self, union_endpoint): + async def test_mixed_literals_get(self, union_endpoint): client = self.create_async_client(endpoint=union_endpoint) response = await client.mixed_literals.get() @@ -24,7 +24,7 @@ async def test_get(self, union_endpoint): @UnionPreparer() @recorded_by_proxy_async - async def test_send(self, union_endpoint): + async def test_mixed_literals_send(self, union_endpoint): client = self.create_async_client(endpoint=union_endpoint) response = await client.mixed_literals.send( body={"prop": {"booleanLiteral": "a", "floatLiteral": "a", "intLiteral": "a", "stringLiteral": "a"}}, diff --git a/packages/typespec-python/test/azure/generated/typetest-union/generated_tests/test_union_mixed_types_operations.py b/packages/typespec-python/test/azure/generated/typetest-union/generated_tests/test_union_mixed_types_operations.py index 5dfcb0fb99a..325317368c6 100644 --- a/packages/typespec-python/test/azure/generated/typetest-union/generated_tests/test_union_mixed_types_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-union/generated_tests/test_union_mixed_types_operations.py @@ -14,7 +14,7 @@ class TestUnionMixedTypesOperations(UnionClientTestBase): @UnionPreparer() @recorded_by_proxy - def test_get(self, union_endpoint): + def test_mixed_types_get(self, union_endpoint): client = self.create_client(endpoint=union_endpoint) response = client.mixed_types.get() @@ -23,7 +23,7 @@ def test_get(self, union_endpoint): @UnionPreparer() @recorded_by_proxy - def test_send(self, union_endpoint): + def test_mixed_types_send(self, union_endpoint): client = self.create_client(endpoint=union_endpoint) response = client.mixed_types.send( body={ diff --git a/packages/typespec-python/test/azure/generated/typetest-union/generated_tests/test_union_mixed_types_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-union/generated_tests/test_union_mixed_types_operations_async.py index 64e8cfed873..b146ea74056 100644 --- a/packages/typespec-python/test/azure/generated/typetest-union/generated_tests/test_union_mixed_types_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-union/generated_tests/test_union_mixed_types_operations_async.py @@ -15,7 +15,7 @@ class TestUnionMixedTypesOperationsAsync(UnionClientTestBaseAsync): @UnionPreparer() @recorded_by_proxy_async - async def test_get(self, union_endpoint): + async def test_mixed_types_get(self, union_endpoint): client = self.create_async_client(endpoint=union_endpoint) response = await client.mixed_types.get() @@ -24,7 +24,7 @@ async def test_get(self, union_endpoint): @UnionPreparer() @recorded_by_proxy_async - async def test_send(self, union_endpoint): + async def test_mixed_types_send(self, union_endpoint): client = self.create_async_client(endpoint=union_endpoint) response = await client.mixed_types.send( body={ diff --git a/packages/typespec-python/test/azure/generated/typetest-union/generated_tests/test_union_models_only_operations.py b/packages/typespec-python/test/azure/generated/typetest-union/generated_tests/test_union_models_only_operations.py index c50224d7198..e932af10a22 100644 --- a/packages/typespec-python/test/azure/generated/typetest-union/generated_tests/test_union_models_only_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-union/generated_tests/test_union_models_only_operations.py @@ -14,7 +14,7 @@ class TestUnionModelsOnlyOperations(UnionClientTestBase): @UnionPreparer() @recorded_by_proxy - def test_get(self, union_endpoint): + def test_models_only_get(self, union_endpoint): client = self.create_client(endpoint=union_endpoint) response = client.models_only.get() @@ -23,7 +23,7 @@ def test_get(self, union_endpoint): @UnionPreparer() @recorded_by_proxy - def test_send(self, union_endpoint): + def test_models_only_send(self, union_endpoint): client = self.create_client(endpoint=union_endpoint) response = client.models_only.send( body={"prop": {"name": "str"}}, diff --git a/packages/typespec-python/test/azure/generated/typetest-union/generated_tests/test_union_models_only_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-union/generated_tests/test_union_models_only_operations_async.py index eeed406a96c..1ee10f9b68e 100644 --- a/packages/typespec-python/test/azure/generated/typetest-union/generated_tests/test_union_models_only_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-union/generated_tests/test_union_models_only_operations_async.py @@ -15,7 +15,7 @@ class TestUnionModelsOnlyOperationsAsync(UnionClientTestBaseAsync): @UnionPreparer() @recorded_by_proxy_async - async def test_get(self, union_endpoint): + async def test_models_only_get(self, union_endpoint): client = self.create_async_client(endpoint=union_endpoint) response = await client.models_only.get() @@ -24,7 +24,7 @@ async def test_get(self, union_endpoint): @UnionPreparer() @recorded_by_proxy_async - async def test_send(self, union_endpoint): + async def test_models_only_send(self, union_endpoint): client = self.create_async_client(endpoint=union_endpoint) response = await client.models_only.send( body={"prop": {"name": "str"}}, diff --git a/packages/typespec-python/test/azure/generated/typetest-union/generated_tests/test_union_string_and_array_operations.py b/packages/typespec-python/test/azure/generated/typetest-union/generated_tests/test_union_string_and_array_operations.py index 0841cf30bb0..4e68cad1acd 100644 --- a/packages/typespec-python/test/azure/generated/typetest-union/generated_tests/test_union_string_and_array_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-union/generated_tests/test_union_string_and_array_operations.py @@ -14,7 +14,7 @@ class TestUnionStringAndArrayOperations(UnionClientTestBase): @UnionPreparer() @recorded_by_proxy - def test_get(self, union_endpoint): + def test_string_and_array_get(self, union_endpoint): client = self.create_client(endpoint=union_endpoint) response = client.string_and_array.get() @@ -23,7 +23,7 @@ def test_get(self, union_endpoint): @UnionPreparer() @recorded_by_proxy - def test_send(self, union_endpoint): + def test_string_and_array_send(self, union_endpoint): client = self.create_client(endpoint=union_endpoint) response = client.string_and_array.send( body={"prop": {"array": "str", "string": "str"}}, diff --git a/packages/typespec-python/test/azure/generated/typetest-union/generated_tests/test_union_string_and_array_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-union/generated_tests/test_union_string_and_array_operations_async.py index fafad25699d..7692fd0bd05 100644 --- a/packages/typespec-python/test/azure/generated/typetest-union/generated_tests/test_union_string_and_array_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-union/generated_tests/test_union_string_and_array_operations_async.py @@ -15,7 +15,7 @@ class TestUnionStringAndArrayOperationsAsync(UnionClientTestBaseAsync): @UnionPreparer() @recorded_by_proxy_async - async def test_get(self, union_endpoint): + async def test_string_and_array_get(self, union_endpoint): client = self.create_async_client(endpoint=union_endpoint) response = await client.string_and_array.get() @@ -24,7 +24,7 @@ async def test_get(self, union_endpoint): @UnionPreparer() @recorded_by_proxy_async - async def test_send(self, union_endpoint): + async def test_string_and_array_send(self, union_endpoint): client = self.create_async_client(endpoint=union_endpoint) response = await client.string_and_array.send( body={"prop": {"array": "str", "string": "str"}}, diff --git a/packages/typespec-python/test/azure/generated/typetest-union/generated_tests/test_union_string_extensible_named_operations.py b/packages/typespec-python/test/azure/generated/typetest-union/generated_tests/test_union_string_extensible_named_operations.py index b6fc017b869..b05ecc2f0c7 100644 --- a/packages/typespec-python/test/azure/generated/typetest-union/generated_tests/test_union_string_extensible_named_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-union/generated_tests/test_union_string_extensible_named_operations.py @@ -14,7 +14,7 @@ class TestUnionStringExtensibleNamedOperations(UnionClientTestBase): @UnionPreparer() @recorded_by_proxy - def test_get(self, union_endpoint): + def test_string_extensible_named_get(self, union_endpoint): client = self.create_client(endpoint=union_endpoint) response = client.string_extensible_named.get() @@ -23,7 +23,7 @@ def test_get(self, union_endpoint): @UnionPreparer() @recorded_by_proxy - def test_send(self, union_endpoint): + def test_string_extensible_named_send(self, union_endpoint): client = self.create_client(endpoint=union_endpoint) response = client.string_extensible_named.send( body={"prop": "str"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-union/generated_tests/test_union_string_extensible_named_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-union/generated_tests/test_union_string_extensible_named_operations_async.py index 7a9e6ca8030..63d9457c2a8 100644 --- a/packages/typespec-python/test/azure/generated/typetest-union/generated_tests/test_union_string_extensible_named_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-union/generated_tests/test_union_string_extensible_named_operations_async.py @@ -15,7 +15,7 @@ class TestUnionStringExtensibleNamedOperationsAsync(UnionClientTestBaseAsync): @UnionPreparer() @recorded_by_proxy_async - async def test_get(self, union_endpoint): + async def test_string_extensible_named_get(self, union_endpoint): client = self.create_async_client(endpoint=union_endpoint) response = await client.string_extensible_named.get() @@ -24,7 +24,7 @@ async def test_get(self, union_endpoint): @UnionPreparer() @recorded_by_proxy_async - async def test_send(self, union_endpoint): + async def test_string_extensible_named_send(self, union_endpoint): client = self.create_async_client(endpoint=union_endpoint) response = await client.string_extensible_named.send( body={"prop": "str"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-union/generated_tests/test_union_string_extensible_operations.py b/packages/typespec-python/test/azure/generated/typetest-union/generated_tests/test_union_string_extensible_operations.py index d0f0a15d841..4514fdc2676 100644 --- a/packages/typespec-python/test/azure/generated/typetest-union/generated_tests/test_union_string_extensible_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-union/generated_tests/test_union_string_extensible_operations.py @@ -14,7 +14,7 @@ class TestUnionStringExtensibleOperations(UnionClientTestBase): @UnionPreparer() @recorded_by_proxy - def test_get(self, union_endpoint): + def test_string_extensible_get(self, union_endpoint): client = self.create_client(endpoint=union_endpoint) response = client.string_extensible.get() @@ -23,7 +23,7 @@ def test_get(self, union_endpoint): @UnionPreparer() @recorded_by_proxy - def test_send(self, union_endpoint): + def test_string_extensible_send(self, union_endpoint): client = self.create_client(endpoint=union_endpoint) response = client.string_extensible.send( body={"prop": "b"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-union/generated_tests/test_union_string_extensible_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-union/generated_tests/test_union_string_extensible_operations_async.py index 2097a5579b0..7150caa0edd 100644 --- a/packages/typespec-python/test/azure/generated/typetest-union/generated_tests/test_union_string_extensible_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-union/generated_tests/test_union_string_extensible_operations_async.py @@ -15,7 +15,7 @@ class TestUnionStringExtensibleOperationsAsync(UnionClientTestBaseAsync): @UnionPreparer() @recorded_by_proxy_async - async def test_get(self, union_endpoint): + async def test_string_extensible_get(self, union_endpoint): client = self.create_async_client(endpoint=union_endpoint) response = await client.string_extensible.get() @@ -24,7 +24,7 @@ async def test_get(self, union_endpoint): @UnionPreparer() @recorded_by_proxy_async - async def test_send(self, union_endpoint): + async def test_string_extensible_send(self, union_endpoint): client = self.create_async_client(endpoint=union_endpoint) response = await client.string_extensible.send( body={"prop": "b"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-union/generated_tests/test_union_strings_only_operations.py b/packages/typespec-python/test/azure/generated/typetest-union/generated_tests/test_union_strings_only_operations.py index 8ae11b8c0d5..2181e8a0ced 100644 --- a/packages/typespec-python/test/azure/generated/typetest-union/generated_tests/test_union_strings_only_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-union/generated_tests/test_union_strings_only_operations.py @@ -14,7 +14,7 @@ class TestUnionStringsOnlyOperations(UnionClientTestBase): @UnionPreparer() @recorded_by_proxy - def test_get(self, union_endpoint): + def test_strings_only_get(self, union_endpoint): client = self.create_client(endpoint=union_endpoint) response = client.strings_only.get() @@ -23,7 +23,7 @@ def test_get(self, union_endpoint): @UnionPreparer() @recorded_by_proxy - def test_send(self, union_endpoint): + def test_strings_only_send(self, union_endpoint): client = self.create_client(endpoint=union_endpoint) response = client.strings_only.send( body={"prop": "a"}, diff --git a/packages/typespec-python/test/azure/generated/typetest-union/generated_tests/test_union_strings_only_operations_async.py b/packages/typespec-python/test/azure/generated/typetest-union/generated_tests/test_union_strings_only_operations_async.py index 05ff9e5d192..89d23916804 100644 --- a/packages/typespec-python/test/azure/generated/typetest-union/generated_tests/test_union_strings_only_operations_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-union/generated_tests/test_union_strings_only_operations_async.py @@ -15,7 +15,7 @@ class TestUnionStringsOnlyOperationsAsync(UnionClientTestBaseAsync): @UnionPreparer() @recorded_by_proxy_async - async def test_get(self, union_endpoint): + async def test_strings_only_get(self, union_endpoint): client = self.create_async_client(endpoint=union_endpoint) response = await client.strings_only.get() @@ -24,7 +24,7 @@ async def test_get(self, union_endpoint): @UnionPreparer() @recorded_by_proxy_async - async def test_send(self, union_endpoint): + async def test_strings_only_send(self, union_endpoint): client = self.create_async_client(endpoint=union_endpoint) response = await client.strings_only.send( body={"prop": "a"}, diff --git a/packages/typespec-python/test/azure/generated/versioning-added/generated_tests/test_added_interface_v2_operations.py b/packages/typespec-python/test/azure/generated/versioning-added/generated_tests/test_added_interface_v2_operations.py index 97e99a5ad13..d29deadeedd 100644 --- a/packages/typespec-python/test/azure/generated/versioning-added/generated_tests/test_added_interface_v2_operations.py +++ b/packages/typespec-python/test/azure/generated/versioning-added/generated_tests/test_added_interface_v2_operations.py @@ -14,7 +14,7 @@ class TestAddedInterfaceV2Operations(AddedClientTestBase): @AddedPreparer() @recorded_by_proxy - def test_v2_in_interface(self, added_endpoint): + def test_interface_v2_v2_in_interface(self, added_endpoint): client = self.create_client(endpoint=added_endpoint) response = client.interface_v2.v2_in_interface( body={"enumProp": "str", "prop": "str", "unionProp": "str"}, diff --git a/packages/typespec-python/test/azure/generated/versioning-added/generated_tests/test_added_interface_v2_operations_async.py b/packages/typespec-python/test/azure/generated/versioning-added/generated_tests/test_added_interface_v2_operations_async.py index 5917253cfd4..653c57ae97f 100644 --- a/packages/typespec-python/test/azure/generated/versioning-added/generated_tests/test_added_interface_v2_operations_async.py +++ b/packages/typespec-python/test/azure/generated/versioning-added/generated_tests/test_added_interface_v2_operations_async.py @@ -15,7 +15,7 @@ class TestAddedInterfaceV2OperationsAsync(AddedClientTestBaseAsync): @AddedPreparer() @recorded_by_proxy_async - async def test_v2_in_interface(self, added_endpoint): + async def test_interface_v2_v2_in_interface(self, added_endpoint): client = self.create_async_client(endpoint=added_endpoint) response = await client.interface_v2.v2_in_interface( body={"enumProp": "str", "prop": "str", "unionProp": "str"}, diff --git a/packages/typespec-python/test/azure/generated/versioning-renamedfrom/generated_tests/test_renamed_from_new_interface_operations.py b/packages/typespec-python/test/azure/generated/versioning-renamedfrom/generated_tests/test_renamed_from_new_interface_operations.py index 08d6fb5fcac..d3aa2db48ef 100644 --- a/packages/typespec-python/test/azure/generated/versioning-renamedfrom/generated_tests/test_renamed_from_new_interface_operations.py +++ b/packages/typespec-python/test/azure/generated/versioning-renamedfrom/generated_tests/test_renamed_from_new_interface_operations.py @@ -14,7 +14,7 @@ class TestRenamedFromNewInterfaceOperations(RenamedFromClientTestBase): @RenamedFromPreparer() @recorded_by_proxy - def test_new_op_in_new_interface(self, renamedfrom_endpoint): + def test_new_interface_new_op_in_new_interface(self, renamedfrom_endpoint): client = self.create_client(endpoint=renamedfrom_endpoint) response = client.new_interface.new_op_in_new_interface( body={"enumProp": "str", "newProp": "str", "unionProp": "str"}, diff --git a/packages/typespec-python/test/azure/generated/versioning-renamedfrom/generated_tests/test_renamed_from_new_interface_operations_async.py b/packages/typespec-python/test/azure/generated/versioning-renamedfrom/generated_tests/test_renamed_from_new_interface_operations_async.py index 0f903592b3d..ded1a984fd9 100644 --- a/packages/typespec-python/test/azure/generated/versioning-renamedfrom/generated_tests/test_renamed_from_new_interface_operations_async.py +++ b/packages/typespec-python/test/azure/generated/versioning-renamedfrom/generated_tests/test_renamed_from_new_interface_operations_async.py @@ -15,7 +15,7 @@ class TestRenamedFromNewInterfaceOperationsAsync(RenamedFromClientTestBaseAsync): @RenamedFromPreparer() @recorded_by_proxy_async - async def test_new_op_in_new_interface(self, renamedfrom_endpoint): + async def test_new_interface_new_op_in_new_interface(self, renamedfrom_endpoint): client = self.create_async_client(endpoint=renamedfrom_endpoint) response = await client.new_interface.new_op_in_new_interface( body={"enumProp": "str", "newProp": "str", "unionProp": "str"}, diff --git a/packages/typespec-python/test/azure/mock_api_tests/asynctests/test_azure_client_generator_core_flatten_async.py b/packages/typespec-python/test/azure/mock_api_tests/asynctests/test_azure_client_generator_core_flatten_async.py index 58a8eeae31e..86a730b529d 100644 --- a/packages/typespec-python/test/azure/mock_api_tests/asynctests/test_azure_client_generator_core_flatten_async.py +++ b/packages/typespec-python/test/azure/mock_api_tests/asynctests/test_azure_client_generator_core_flatten_async.py @@ -4,8 +4,8 @@ # license information. # -------------------------------------------------------------------------- import pytest -from azure.clientgenerator.core.flattenproperty.aio import FlattenPropertyClient -from azure.clientgenerator.core.flattenproperty.models import ( +from specs.azure.clientgenerator.core.flattenproperty.aio import FlattenPropertyClient +from specs.azure.clientgenerator.core.flattenproperty.models import ( FlattenModel, ChildModel, NestedFlattenModel, diff --git a/packages/typespec-python/test/azure/mock_api_tests/test_azure_client_generator_core_flatten.py b/packages/typespec-python/test/azure/mock_api_tests/test_azure_client_generator_core_flatten.py index 2a509a98e92..6d767845054 100644 --- a/packages/typespec-python/test/azure/mock_api_tests/test_azure_client_generator_core_flatten.py +++ b/packages/typespec-python/test/azure/mock_api_tests/test_azure_client_generator_core_flatten.py @@ -4,8 +4,8 @@ # license information. # -------------------------------------------------------------------------- import pytest -from azure.clientgenerator.core.flattenproperty import FlattenPropertyClient -from azure.clientgenerator.core.flattenproperty.models import ( +from specs.azure.clientgenerator.core.flattenproperty import FlattenPropertyClient +from specs.azure.clientgenerator.core.flattenproperty.models import ( FlattenModel, ChildModel, NestedFlattenModel, diff --git a/packages/typespec-python/test/generic_mock_api_tests/asynctests/test_payload_multipart_async.py b/packages/typespec-python/test/generic_mock_api_tests/asynctests/test_payload_multipart_async.py index 76cfbf57e1c..b6541c4df12 100644 --- a/packages/typespec-python/test/generic_mock_api_tests/asynctests/test_payload_multipart_async.py +++ b/packages/typespec-python/test/generic_mock_api_tests/asynctests/test_payload_multipart_async.py @@ -58,7 +58,7 @@ async def test_check_file_name_and_content_type(client: MultiPartClient): @pytest.mark.asyncio async def test_complex(client: MultiPartClient): - await client.form_data.complex( + await client.form_data.file_array_and_basic( models.ComplexPartsRequest( id="123", address=models.Address(city="X"), @@ -98,7 +98,7 @@ async def test_multi_binary_parts(client: MultiPartClient): @pytest.mark.asyncio async def test_file_with_http_part_specific_content_type(client: MultiPartClient): - await client.form_data.file_with_http_part_specific_content_type( + await client.form_data.http_parts.content_type.image_jpeg_content_type( models.FileWithHttpPartSpecificContentTypeRequest( profile_image=("hello.jpg", open(str(JPG), "rb"), "image/jpg"), ) @@ -107,7 +107,7 @@ async def test_file_with_http_part_specific_content_type(client: MultiPartClient @pytest.mark.asyncio async def test_file_with_http_part_required_content_type(client: MultiPartClient): - await client.form_data.file_with_http_part_required_content_type( + await client.form_data.http_parts.content_type.required_content_type( models.FileWithHttpPartRequiredContentTypeRequest( profile_image=open(str(JPG), "rb"), ) @@ -117,12 +117,12 @@ async def test_file_with_http_part_required_content_type(client: MultiPartClient @pytest.mark.asyncio async def test_file_with_http_part_optional_content_type(client: MultiPartClient): # call twice: one with content type, one without - await client.form_data.file_with_http_part_optional_content_type( + await client.form_data.http_parts.content_type.optional_content_type( models.FileWithHttpPartOptionalContentTypeRequest( profile_image=("hello.jpg", open(str(JPG), "rb").read()), ) ) - await client.form_data.file_with_http_part_optional_content_type( + await client.form_data.http_parts.content_type.optional_content_type( models.FileWithHttpPartOptionalContentTypeRequest( profile_image=("hello.jpg", open(str(JPG), "rb").read(), "application/octet-stream"), ) @@ -131,7 +131,7 @@ async def test_file_with_http_part_optional_content_type(client: MultiPartClient @pytest.mark.asyncio async def test_complex_with_http_part(client: MultiPartClient): - await client.form_data.complex_with_http_part( + await client.form_data.http_parts.json_array_and_file_array( models.ComplexHttpPartsModelRequest( id="123", previous_addresses=[ @@ -146,3 +146,8 @@ async def test_complex_with_http_part(client: MultiPartClient): profile_image=open(str(JPG), "rb"), ) ) + + +@pytest.mark.asyncio +async def test_http_parts_non_string_float(client: MultiPartClient): + await client.form_data.http_parts.non_string.float(models.FloatRequest(temperature=0.5)) diff --git a/packages/typespec-python/test/generic_mock_api_tests/test_payload_multipart.py b/packages/typespec-python/test/generic_mock_api_tests/test_payload_multipart.py index 6d4876820d6..f9a49c85a87 100644 --- a/packages/typespec-python/test/generic_mock_api_tests/test_payload_multipart.py +++ b/packages/typespec-python/test/generic_mock_api_tests/test_payload_multipart.py @@ -52,7 +52,7 @@ def test_check_file_name_and_content_type(client: MultiPartClient): def test_complex(client: MultiPartClient): - client.form_data.complex( + client.form_data.file_array_and_basic( models.ComplexPartsRequest( id="123", address=models.Address(city="X"), @@ -89,7 +89,7 @@ def test_multi_binary_parts(client: MultiPartClient): def test_file_with_http_part_specific_content_type(client: MultiPartClient): - client.form_data.file_with_http_part_specific_content_type( + client.form_data.http_parts.content_type.image_jpeg_content_type( models.FileWithHttpPartSpecificContentTypeRequest( profile_image=("hello.jpg", open(str(JPG), "rb"), "image/jpg"), ) @@ -97,7 +97,7 @@ def test_file_with_http_part_specific_content_type(client: MultiPartClient): def test_file_with_http_part_required_content_type(client: MultiPartClient): - client.form_data.file_with_http_part_required_content_type( + client.form_data.http_parts.content_type.required_content_type( models.FileWithHttpPartRequiredContentTypeRequest( profile_image=open(str(JPG), "rb"), ) @@ -106,12 +106,12 @@ def test_file_with_http_part_required_content_type(client: MultiPartClient): def test_file_with_http_part_optional_content_type(client: MultiPartClient): # call twice: one with content type, one without - client.form_data.file_with_http_part_optional_content_type( + client.form_data.http_parts.content_type.optional_content_type( models.FileWithHttpPartOptionalContentTypeRequest( profile_image=("hello.jpg", open(str(JPG), "rb").read()), ) ) - client.form_data.file_with_http_part_optional_content_type( + client.form_data.http_parts.content_type.optional_content_type( models.FileWithHttpPartOptionalContentTypeRequest( profile_image=("hello.jpg", open(str(JPG), "rb").read(), "application/octet-stream"), ) @@ -119,7 +119,7 @@ def test_file_with_http_part_optional_content_type(client: MultiPartClient): def test_complex_with_http_part(client: MultiPartClient): - client.form_data.complex_with_http_part( + client.form_data.http_parts.json_array_and_file_array( models.ComplexHttpPartsModelRequest( id="123", previous_addresses=[ @@ -134,3 +134,7 @@ def test_complex_with_http_part(client: MultiPartClient): profile_image=open(str(JPG), "rb"), ) ) + + +def test_http_parts_non_string_float(client: MultiPartClient): + client.form_data.http_parts.non_string.float(models.FloatRequest(temperature=0.5)) diff --git a/packages/typespec-python/test/unbranded/generated/encode-numeric/encode/numeric/aio/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/encode-numeric/encode/numeric/aio/operations/_operations.py index 5cc65d7e308..5608553a231 100644 --- a/packages/typespec-python/test/unbranded/generated/encode-numeric/encode/numeric/aio/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/encode-numeric/encode/numeric/aio/operations/_operations.py @@ -30,6 +30,7 @@ from ...operations._operations import ( build_property_safeint_as_string_request, build_property_uint32_as_string_optional_request, + build_property_uint8_as_string_request, ) if sys.version_info >= (3, 9): @@ -60,12 +61,12 @@ def __init__(self, *args, **kwargs) -> None: @overload async def safeint_as_string( - self, body: _models.SafeintAsStringProperty, *, content_type: str = "application/json", **kwargs: Any + self, value: _models.SafeintAsStringProperty, *, content_type: str = "application/json", **kwargs: Any ) -> _models.SafeintAsStringProperty: """safeint_as_string. - :param body: Required. - :type body: ~encode.numeric.models.SafeintAsStringProperty + :param value: Required. + :type value: ~encode.numeric.models.SafeintAsStringProperty :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -76,12 +77,12 @@ async def safeint_as_string( @overload async def safeint_as_string( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, value: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.SafeintAsStringProperty: """safeint_as_string. - :param body: Required. - :type body: JSON + :param value: Required. + :type value: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -92,12 +93,12 @@ async def safeint_as_string( @overload async def safeint_as_string( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + self, value: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.SafeintAsStringProperty: """safeint_as_string. - :param body: Required. - :type body: IO[bytes] + :param value: Required. + :type value: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -107,12 +108,12 @@ async def safeint_as_string( """ async def safeint_as_string( - self, body: Union[_models.SafeintAsStringProperty, JSON, IO[bytes]], **kwargs: Any + self, value: Union[_models.SafeintAsStringProperty, JSON, IO[bytes]], **kwargs: Any ) -> _models.SafeintAsStringProperty: """safeint_as_string. - :param body: Is one of the following types: SafeintAsStringProperty, JSON, IO[bytes] Required. - :type body: ~encode.numeric.models.SafeintAsStringProperty or JSON or IO[bytes] + :param value: Is one of the following types: SafeintAsStringProperty, JSON, IO[bytes] Required. + :type value: ~encode.numeric.models.SafeintAsStringProperty or JSON or IO[bytes] :return: SafeintAsStringProperty. The SafeintAsStringProperty is compatible with MutableMapping :rtype: ~encode.numeric.models.SafeintAsStringProperty :raises ~corehttp.exceptions.HttpResponseError: @@ -133,10 +134,10 @@ async def safeint_as_string( content_type = content_type or "application/json" _content = None - if isinstance(body, (IOBase, bytes)): - _content = body + if isinstance(value, (IOBase, bytes)): + _content = value else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(value, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_property_safeint_as_string_request( content_type=content_type, @@ -177,12 +178,12 @@ async def safeint_as_string( @overload async def uint32_as_string_optional( - self, body: _models.Uint32AsStringProperty, *, content_type: str = "application/json", **kwargs: Any + self, value: _models.Uint32AsStringProperty, *, content_type: str = "application/json", **kwargs: Any ) -> _models.Uint32AsStringProperty: """uint32_as_string_optional. - :param body: Required. - :type body: ~encode.numeric.models.Uint32AsStringProperty + :param value: Required. + :type value: ~encode.numeric.models.Uint32AsStringProperty :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -193,12 +194,12 @@ async def uint32_as_string_optional( @overload async def uint32_as_string_optional( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, value: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.Uint32AsStringProperty: """uint32_as_string_optional. - :param body: Required. - :type body: JSON + :param value: Required. + :type value: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -209,12 +210,12 @@ async def uint32_as_string_optional( @overload async def uint32_as_string_optional( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + self, value: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.Uint32AsStringProperty: """uint32_as_string_optional. - :param body: Required. - :type body: IO[bytes] + :param value: Required. + :type value: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -224,12 +225,12 @@ async def uint32_as_string_optional( """ async def uint32_as_string_optional( - self, body: Union[_models.Uint32AsStringProperty, JSON, IO[bytes]], **kwargs: Any + self, value: Union[_models.Uint32AsStringProperty, JSON, IO[bytes]], **kwargs: Any ) -> _models.Uint32AsStringProperty: """uint32_as_string_optional. - :param body: Is one of the following types: Uint32AsStringProperty, JSON, IO[bytes] Required. - :type body: ~encode.numeric.models.Uint32AsStringProperty or JSON or IO[bytes] + :param value: Is one of the following types: Uint32AsStringProperty, JSON, IO[bytes] Required. + :type value: ~encode.numeric.models.Uint32AsStringProperty or JSON or IO[bytes] :return: Uint32AsStringProperty. The Uint32AsStringProperty is compatible with MutableMapping :rtype: ~encode.numeric.models.Uint32AsStringProperty :raises ~corehttp.exceptions.HttpResponseError: @@ -250,10 +251,10 @@ async def uint32_as_string_optional( content_type = content_type or "application/json" _content = None - if isinstance(body, (IOBase, bytes)): - _content = body + if isinstance(value, (IOBase, bytes)): + _content = value else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(value, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_property_uint32_as_string_optional_request( content_type=content_type, @@ -291,3 +292,120 @@ async def uint32_as_string_optional( return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore + + @overload + async def uint8_as_string( + self, value: _models.Uint8AsStringProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Uint8AsStringProperty: + """uint8_as_string. + + :param value: Required. + :type value: ~encode.numeric.models.Uint8AsStringProperty + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Uint8AsStringProperty. The Uint8AsStringProperty is compatible with MutableMapping + :rtype: ~encode.numeric.models.Uint8AsStringProperty + :raises ~corehttp.exceptions.HttpResponseError: + """ + + @overload + async def uint8_as_string( + self, value: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Uint8AsStringProperty: + """uint8_as_string. + + :param value: Required. + :type value: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Uint8AsStringProperty. The Uint8AsStringProperty is compatible with MutableMapping + :rtype: ~encode.numeric.models.Uint8AsStringProperty + :raises ~corehttp.exceptions.HttpResponseError: + """ + + @overload + async def uint8_as_string( + self, value: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Uint8AsStringProperty: + """uint8_as_string. + + :param value: Required. + :type value: 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: Uint8AsStringProperty. The Uint8AsStringProperty is compatible with MutableMapping + :rtype: ~encode.numeric.models.Uint8AsStringProperty + :raises ~corehttp.exceptions.HttpResponseError: + """ + + async def uint8_as_string( + self, value: Union[_models.Uint8AsStringProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models.Uint8AsStringProperty: + """uint8_as_string. + + :param value: Is one of the following types: Uint8AsStringProperty, JSON, IO[bytes] Required. + :type value: ~encode.numeric.models.Uint8AsStringProperty or JSON or IO[bytes] + :return: Uint8AsStringProperty. The Uint8AsStringProperty is compatible with MutableMapping + :rtype: ~encode.numeric.models.Uint8AsStringProperty + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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[_models.Uint8AsStringProperty] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(value, (IOBase, bytes)): + _content = value + else: + _content = json.dumps(value, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_property_uint8_as_string_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(_models.Uint8AsStringProperty, 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-numeric/encode/numeric/models/__init__.py b/packages/typespec-python/test/unbranded/generated/encode-numeric/encode/numeric/models/__init__.py index 75ecba0a7ea..79b4558ed2b 100644 --- a/packages/typespec-python/test/unbranded/generated/encode-numeric/encode/numeric/models/__init__.py +++ b/packages/typespec-python/test/unbranded/generated/encode-numeric/encode/numeric/models/__init__.py @@ -8,6 +8,7 @@ from ._models import SafeintAsStringProperty from ._models import Uint32AsStringProperty +from ._models import Uint8AsStringProperty from ._patch import __all__ as _patch_all from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk @@ -15,6 +16,7 @@ __all__ = [ "SafeintAsStringProperty", "Uint32AsStringProperty", + "Uint8AsStringProperty", ] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/packages/typespec-python/test/unbranded/generated/encode-numeric/encode/numeric/models/_models.py b/packages/typespec-python/test/unbranded/generated/encode-numeric/encode/numeric/models/_models.py index 3a13c8a410d..6a1fdd2bcde 100644 --- a/packages/typespec-python/test/unbranded/generated/encode-numeric/encode/numeric/models/_models.py +++ b/packages/typespec-python/test/unbranded/generated/encode-numeric/encode/numeric/models/_models.py @@ -67,3 +67,32 @@ def __init__(self, mapping: Mapping[str, Any]): def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation super().__init__(*args, **kwargs) + + +class Uint8AsStringProperty(_model_base.Model): + """Uint8AsStringProperty. + + + :ivar value: Required. + :vartype value: int + """ + + value: int = rest_field(format="str") + """Required.""" + + @overload + def __init__( + self, + *, + value: int, + ): ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) diff --git a/packages/typespec-python/test/unbranded/generated/encode-numeric/encode/numeric/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/encode-numeric/encode/numeric/operations/_operations.py index 25589960f2d..006267ebe96 100644 --- a/packages/typespec-python/test/unbranded/generated/encode-numeric/encode/numeric/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/encode-numeric/encode/numeric/operations/_operations.py @@ -75,6 +75,23 @@ def build_property_uint32_as_string_optional_request(**kwargs: Any) -> HttpReque return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) +def build_property_uint8_as_string_request(**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/numeric/property/uint8" + + # 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:: @@ -94,12 +111,12 @@ def __init__(self, *args, **kwargs): @overload def safeint_as_string( - self, body: _models.SafeintAsStringProperty, *, content_type: str = "application/json", **kwargs: Any + self, value: _models.SafeintAsStringProperty, *, content_type: str = "application/json", **kwargs: Any ) -> _models.SafeintAsStringProperty: """safeint_as_string. - :param body: Required. - :type body: ~encode.numeric.models.SafeintAsStringProperty + :param value: Required. + :type value: ~encode.numeric.models.SafeintAsStringProperty :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -110,12 +127,12 @@ def safeint_as_string( @overload def safeint_as_string( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, value: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.SafeintAsStringProperty: """safeint_as_string. - :param body: Required. - :type body: JSON + :param value: Required. + :type value: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -126,12 +143,12 @@ def safeint_as_string( @overload def safeint_as_string( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + self, value: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.SafeintAsStringProperty: """safeint_as_string. - :param body: Required. - :type body: IO[bytes] + :param value: Required. + :type value: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -141,12 +158,12 @@ def safeint_as_string( """ def safeint_as_string( - self, body: Union[_models.SafeintAsStringProperty, JSON, IO[bytes]], **kwargs: Any + self, value: Union[_models.SafeintAsStringProperty, JSON, IO[bytes]], **kwargs: Any ) -> _models.SafeintAsStringProperty: """safeint_as_string. - :param body: Is one of the following types: SafeintAsStringProperty, JSON, IO[bytes] Required. - :type body: ~encode.numeric.models.SafeintAsStringProperty or JSON or IO[bytes] + :param value: Is one of the following types: SafeintAsStringProperty, JSON, IO[bytes] Required. + :type value: ~encode.numeric.models.SafeintAsStringProperty or JSON or IO[bytes] :return: SafeintAsStringProperty. The SafeintAsStringProperty is compatible with MutableMapping :rtype: ~encode.numeric.models.SafeintAsStringProperty :raises ~corehttp.exceptions.HttpResponseError: @@ -167,10 +184,10 @@ def safeint_as_string( content_type = content_type or "application/json" _content = None - if isinstance(body, (IOBase, bytes)): - _content = body + if isinstance(value, (IOBase, bytes)): + _content = value else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(value, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_property_safeint_as_string_request( content_type=content_type, @@ -211,12 +228,12 @@ def safeint_as_string( @overload def uint32_as_string_optional( - self, body: _models.Uint32AsStringProperty, *, content_type: str = "application/json", **kwargs: Any + self, value: _models.Uint32AsStringProperty, *, content_type: str = "application/json", **kwargs: Any ) -> _models.Uint32AsStringProperty: """uint32_as_string_optional. - :param body: Required. - :type body: ~encode.numeric.models.Uint32AsStringProperty + :param value: Required. + :type value: ~encode.numeric.models.Uint32AsStringProperty :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -227,12 +244,12 @@ def uint32_as_string_optional( @overload def uint32_as_string_optional( - self, body: JSON, *, content_type: str = "application/json", **kwargs: Any + self, value: JSON, *, content_type: str = "application/json", **kwargs: Any ) -> _models.Uint32AsStringProperty: """uint32_as_string_optional. - :param body: Required. - :type body: JSON + :param value: Required. + :type value: JSON :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -243,12 +260,12 @@ def uint32_as_string_optional( @overload def uint32_as_string_optional( - self, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + self, value: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> _models.Uint32AsStringProperty: """uint32_as_string_optional. - :param body: Required. - :type body: IO[bytes] + :param value: Required. + :type value: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -258,12 +275,12 @@ def uint32_as_string_optional( """ def uint32_as_string_optional( - self, body: Union[_models.Uint32AsStringProperty, JSON, IO[bytes]], **kwargs: Any + self, value: Union[_models.Uint32AsStringProperty, JSON, IO[bytes]], **kwargs: Any ) -> _models.Uint32AsStringProperty: """uint32_as_string_optional. - :param body: Is one of the following types: Uint32AsStringProperty, JSON, IO[bytes] Required. - :type body: ~encode.numeric.models.Uint32AsStringProperty or JSON or IO[bytes] + :param value: Is one of the following types: Uint32AsStringProperty, JSON, IO[bytes] Required. + :type value: ~encode.numeric.models.Uint32AsStringProperty or JSON or IO[bytes] :return: Uint32AsStringProperty. The Uint32AsStringProperty is compatible with MutableMapping :rtype: ~encode.numeric.models.Uint32AsStringProperty :raises ~corehttp.exceptions.HttpResponseError: @@ -284,10 +301,10 @@ def uint32_as_string_optional( content_type = content_type or "application/json" _content = None - if isinstance(body, (IOBase, bytes)): - _content = body + if isinstance(value, (IOBase, bytes)): + _content = value else: - _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + _content = json.dumps(value, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_property_uint32_as_string_optional_request( content_type=content_type, @@ -325,3 +342,120 @@ def uint32_as_string_optional( return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore + + @overload + def uint8_as_string( + self, value: _models.Uint8AsStringProperty, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Uint8AsStringProperty: + """uint8_as_string. + + :param value: Required. + :type value: ~encode.numeric.models.Uint8AsStringProperty + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Uint8AsStringProperty. The Uint8AsStringProperty is compatible with MutableMapping + :rtype: ~encode.numeric.models.Uint8AsStringProperty + :raises ~corehttp.exceptions.HttpResponseError: + """ + + @overload + def uint8_as_string( + self, value: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Uint8AsStringProperty: + """uint8_as_string. + + :param value: Required. + :type value: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Uint8AsStringProperty. The Uint8AsStringProperty is compatible with MutableMapping + :rtype: ~encode.numeric.models.Uint8AsStringProperty + :raises ~corehttp.exceptions.HttpResponseError: + """ + + @overload + def uint8_as_string( + self, value: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.Uint8AsStringProperty: + """uint8_as_string. + + :param value: Required. + :type value: 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: Uint8AsStringProperty. The Uint8AsStringProperty is compatible with MutableMapping + :rtype: ~encode.numeric.models.Uint8AsStringProperty + :raises ~corehttp.exceptions.HttpResponseError: + """ + + def uint8_as_string( + self, value: Union[_models.Uint8AsStringProperty, JSON, IO[bytes]], **kwargs: Any + ) -> _models.Uint8AsStringProperty: + """uint8_as_string. + + :param value: Is one of the following types: Uint8AsStringProperty, JSON, IO[bytes] Required. + :type value: ~encode.numeric.models.Uint8AsStringProperty or JSON or IO[bytes] + :return: Uint8AsStringProperty. The Uint8AsStringProperty is compatible with MutableMapping + :rtype: ~encode.numeric.models.Uint8AsStringProperty + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 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[_models.Uint8AsStringProperty] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(value, (IOBase, bytes)): + _content = value + else: + _content = json.dumps(value, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_property_uint8_as_string_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(_models.Uint8AsStringProperty, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore diff --git a/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/aio/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/aio/operations/_operations.py index bad278bf275..4c9fc5f467e 100644 --- a/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/aio/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/aio/operations/_operations.py @@ -27,11 +27,12 @@ build_form_data_basic_request, build_form_data_binary_array_parts_request, build_form_data_check_file_name_and_content_type_request, - build_form_data_complex_request, - build_form_data_complex_with_http_part_request, - build_form_data_file_with_http_part_optional_content_type_request, - build_form_data_file_with_http_part_required_content_type_request, - build_form_data_file_with_http_part_specific_content_type_request, + build_form_data_file_array_and_basic_request, + build_form_data_http_parts_content_type_image_jpeg_content_type_request, + build_form_data_http_parts_content_type_optional_content_type_request, + build_form_data_http_parts_content_type_required_content_type_request, + build_form_data_http_parts_json_array_and_file_array_request, + build_form_data_http_parts_non_string_float_request, build_form_data_json_part_request, build_form_data_multi_binary_parts_request, ) @@ -63,6 +64,8 @@ def __init__(self, *args, **kwargs) -> None: self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self.http_parts = FormDataHttpPartsOperations(self._client, self._config, self._serialize, self._deserialize) + @overload async def basic( # pylint: disable=inconsistent-return-statements self, body: _models.MultiPartRequest, **kwargs: Any @@ -142,7 +145,7 @@ async def basic( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @overload - async def complex( # pylint: disable=inconsistent-return-statements + async def file_array_and_basic( # pylint: disable=inconsistent-return-statements self, body: _models.ComplexPartsRequest, **kwargs: Any ) -> None: """Test content-type: multipart/form-data for mixed scenarios. @@ -155,7 +158,9 @@ async def complex( # pylint: disable=inconsistent-return-statements """ @overload - async def complex(self, body: JSON, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + async def file_array_and_basic( # pylint: disable=inconsistent-return-statements + self, body: JSON, **kwargs: Any + ) -> None: """Test content-type: multipart/form-data for mixed scenarios. :param body: Required. @@ -165,7 +170,7 @@ async def complex(self, body: JSON, **kwargs: Any) -> None: # pylint: disable=i :raises ~corehttp.exceptions.HttpResponseError: """ - async def complex( # pylint: disable=inconsistent-return-statements + async def file_array_and_basic( # pylint: disable=inconsistent-return-statements self, body: Union[_models.ComplexPartsRequest, JSON], **kwargs: Any ) -> None: """Test content-type: multipart/form-data for mixed scenarios. @@ -194,7 +199,7 @@ async def complex( # pylint: disable=inconsistent-return-statements _data_fields: List[str] = ["id", "address"] _files, _data = prepare_multipart_form_data(_body, _file_fields, _data_fields) - _request = build_form_data_complex_request( + _request = build_form_data_file_array_and_basic_request( files=_files, data=_data, headers=_headers, @@ -624,8 +629,131 @@ async def anonymous_model( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) # type: ignore + +class FormDataHttpPartsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~payload.multipart.aio.MultiPartClient`'s + :attr:`http_parts` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + self.content_type = FormDataHttpPartsContentTypeOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.non_string = FormDataHttpPartsNonStringOperations( + self._client, self._config, self._serialize, self._deserialize + ) + + @overload + async def json_array_and_file_array( # pylint: disable=inconsistent-return-statements + self, body: _models.ComplexHttpPartsModelRequest, **kwargs: Any + ) -> None: + """Test content-type: multipart/form-data for mixed scenarios. + + :param body: Required. + :type body: ~payload.multipart.models.ComplexHttpPartsModelRequest + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + + @overload + async def json_array_and_file_array( # pylint: disable=inconsistent-return-statements + self, body: JSON, **kwargs: Any + ) -> None: + """Test content-type: multipart/form-data for mixed scenarios. + + :param body: Required. + :type body: JSON + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + + async def json_array_and_file_array( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.ComplexHttpPartsModelRequest, JSON], **kwargs: Any + ) -> None: + """Test content-type: multipart/form-data for mixed scenarios. + + :param body: Is either a ComplexHttpPartsModelRequest type or a JSON type. Required. + :type body: ~payload.multipart.models.ComplexHttpPartsModelRequest or JSON + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _body = body.as_dict() if isinstance(body, _model_base.Model) else body + _file_fields: List[str] = ["profileImage", "pictures"] + _data_fields: List[str] = ["id", "address", "previousAddresses"] + _files, _data = prepare_multipart_form_data(_body, _file_fields, _data_fields) + + _request = build_form_data_http_parts_json_array_and_file_array_request( + files=_files, + data=_data, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class FormDataHttpPartsContentTypeOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~payload.multipart.aio.MultiPartClient`'s + :attr:`content_type` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @overload - async def file_with_http_part_specific_content_type( # pylint: disable=inconsistent-return-statements,name-too-long + async def image_jpeg_content_type( # pylint: disable=inconsistent-return-statements self, body: _models.FileWithHttpPartSpecificContentTypeRequest, **kwargs: Any ) -> None: """Test content-type: multipart/form-data. @@ -638,7 +766,7 @@ async def file_with_http_part_specific_content_type( # pylint: disable=inconsis """ @overload - async def file_with_http_part_specific_content_type( # pylint: disable=inconsistent-return-statements,name-too-long + async def image_jpeg_content_type( # pylint: disable=inconsistent-return-statements self, body: JSON, **kwargs: Any ) -> None: """Test content-type: multipart/form-data. @@ -650,7 +778,7 @@ async def file_with_http_part_specific_content_type( # pylint: disable=inconsis :raises ~corehttp.exceptions.HttpResponseError: """ - async def file_with_http_part_specific_content_type( # pylint: disable=inconsistent-return-statements,name-too-long + async def image_jpeg_content_type( # pylint: disable=inconsistent-return-statements self, body: Union[_models.FileWithHttpPartSpecificContentTypeRequest, JSON], **kwargs: Any ) -> None: """Test content-type: multipart/form-data. @@ -680,7 +808,7 @@ async def file_with_http_part_specific_content_type( # pylint: disable=inconsis _data_fields: List[str] = [] _files, _data = prepare_multipart_form_data(_body, _file_fields, _data_fields) - _request = build_form_data_file_with_http_part_specific_content_type_request( + _request = build_form_data_http_parts_content_type_image_jpeg_content_type_request( files=_files, data=_data, headers=_headers, @@ -706,7 +834,7 @@ async def file_with_http_part_specific_content_type( # pylint: disable=inconsis return cls(pipeline_response, None, {}) # type: ignore @overload - async def file_with_http_part_required_content_type( # pylint: disable=inconsistent-return-statements,name-too-long + async def required_content_type( # pylint: disable=inconsistent-return-statements self, body: _models.FileWithHttpPartRequiredContentTypeRequest, **kwargs: Any ) -> None: """Test content-type: multipart/form-data. @@ -719,7 +847,7 @@ async def file_with_http_part_required_content_type( # pylint: disable=inconsis """ @overload - async def file_with_http_part_required_content_type( # pylint: disable=inconsistent-return-statements,name-too-long + async def required_content_type( # pylint: disable=inconsistent-return-statements self, body: JSON, **kwargs: Any ) -> None: """Test content-type: multipart/form-data. @@ -731,7 +859,7 @@ async def file_with_http_part_required_content_type( # pylint: disable=inconsis :raises ~corehttp.exceptions.HttpResponseError: """ - async def file_with_http_part_required_content_type( # pylint: disable=inconsistent-return-statements,name-too-long + async def required_content_type( # pylint: disable=inconsistent-return-statements self, body: Union[_models.FileWithHttpPartRequiredContentTypeRequest, JSON], **kwargs: Any ) -> None: """Test content-type: multipart/form-data. @@ -761,7 +889,7 @@ async def file_with_http_part_required_content_type( # pylint: disable=inconsis _data_fields: List[str] = [] _files, _data = prepare_multipart_form_data(_body, _file_fields, _data_fields) - _request = build_form_data_file_with_http_part_required_content_type_request( + _request = build_form_data_http_parts_content_type_required_content_type_request( files=_files, data=_data, headers=_headers, @@ -787,7 +915,7 @@ async def file_with_http_part_required_content_type( # pylint: disable=inconsis return cls(pipeline_response, None, {}) # type: ignore @overload - async def file_with_http_part_optional_content_type( # pylint: disable=inconsistent-return-statements,name-too-long + async def optional_content_type( # pylint: disable=inconsistent-return-statements self, body: _models.FileWithHttpPartOptionalContentTypeRequest, **kwargs: Any ) -> None: """Test content-type: multipart/form-data for optional content type. @@ -800,7 +928,7 @@ async def file_with_http_part_optional_content_type( # pylint: disable=inconsis """ @overload - async def file_with_http_part_optional_content_type( # pylint: disable=inconsistent-return-statements,name-too-long + async def optional_content_type( # pylint: disable=inconsistent-return-statements self, body: JSON, **kwargs: Any ) -> None: """Test content-type: multipart/form-data for optional content type. @@ -812,7 +940,7 @@ async def file_with_http_part_optional_content_type( # pylint: disable=inconsis :raises ~corehttp.exceptions.HttpResponseError: """ - async def file_with_http_part_optional_content_type( # pylint: disable=inconsistent-return-statements,name-too-long + async def optional_content_type( # pylint: disable=inconsistent-return-statements self, body: Union[_models.FileWithHttpPartOptionalContentTypeRequest, JSON], **kwargs: Any ) -> None: """Test content-type: multipart/form-data for optional content type. @@ -842,7 +970,7 @@ async def file_with_http_part_optional_content_type( # pylint: disable=inconsis _data_fields: List[str] = [] _files, _data = prepare_multipart_form_data(_body, _file_fields, _data_fields) - _request = build_form_data_file_with_http_part_optional_content_type_request( + _request = build_form_data_http_parts_content_type_optional_content_type_request( files=_files, data=_data, headers=_headers, @@ -867,24 +995,40 @@ async def file_with_http_part_optional_content_type( # pylint: disable=inconsis if cls: return cls(pipeline_response, None, {}) # type: ignore + +class FormDataHttpPartsNonStringOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~payload.multipart.aio.MultiPartClient`'s + :attr:`non_string` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @overload - async def complex_with_http_part( # pylint: disable=inconsistent-return-statements - self, body: _models.ComplexHttpPartsModelRequest, **kwargs: Any + async def float( # pylint: disable=inconsistent-return-statements + self, body: _models.FloatRequest, **kwargs: Any ) -> None: - """Test content-type: multipart/form-data for mixed scenarios. + """Test content-type: multipart/form-data for non string. :param body: Required. - :type body: ~payload.multipart.models.ComplexHttpPartsModelRequest + :type body: ~payload.multipart.models.FloatRequest :return: None :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ @overload - async def complex_with_http_part( # pylint: disable=inconsistent-return-statements - self, body: JSON, **kwargs: Any - ) -> None: - """Test content-type: multipart/form-data for mixed scenarios. + async def float(self, body: JSON, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """Test content-type: multipart/form-data for non string. :param body: Required. :type body: JSON @@ -893,13 +1037,13 @@ async def complex_with_http_part( # pylint: disable=inconsistent-return-stateme :raises ~corehttp.exceptions.HttpResponseError: """ - async def complex_with_http_part( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.ComplexHttpPartsModelRequest, JSON], **kwargs: Any + async def float( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.FloatRequest, JSON], **kwargs: Any ) -> None: - """Test content-type: multipart/form-data for mixed scenarios. + """Test content-type: multipart/form-data for non string. - :param body: Is either a ComplexHttpPartsModelRequest type or a JSON type. Required. - :type body: ~payload.multipart.models.ComplexHttpPartsModelRequest or JSON + :param body: Is either a FloatRequest type or a JSON type. Required. + :type body: ~payload.multipart.models.FloatRequest or JSON :return: None :rtype: None :raises ~corehttp.exceptions.HttpResponseError: @@ -918,11 +1062,11 @@ async def complex_with_http_part( # pylint: disable=inconsistent-return-stateme cls: ClsType[None] = kwargs.pop("cls", None) _body = body.as_dict() if isinstance(body, _model_base.Model) else body - _file_fields: List[str] = ["profileImage", "pictures"] - _data_fields: List[str] = ["id", "address", "previousAddresses"] + _file_fields: List[str] = [] + _data_fields: List[str] = ["temperature"] _files, _data = prepare_multipart_form_data(_body, _file_fields, _data_fields) - _request = build_form_data_complex_with_http_part_request( + _request = build_form_data_http_parts_non_string_float_request( files=_files, data=_data, headers=_headers, diff --git a/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/models/__init__.py b/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/models/__init__.py index 73786d8beee..74933c5183a 100644 --- a/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/models/__init__.py +++ b/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/models/__init__.py @@ -13,6 +13,7 @@ from ._models import FileWithHttpPartOptionalContentTypeRequest from ._models import FileWithHttpPartRequiredContentTypeRequest from ._models import FileWithHttpPartSpecificContentTypeRequest +from ._models import FloatRequest from ._models import JsonPartRequest from ._models import MultiBinaryPartsRequest from ._models import MultiPartRequest @@ -28,6 +29,7 @@ "FileWithHttpPartOptionalContentTypeRequest", "FileWithHttpPartRequiredContentTypeRequest", "FileWithHttpPartSpecificContentTypeRequest", + "FloatRequest", "JsonPartRequest", "MultiBinaryPartsRequest", "MultiPartRequest", diff --git a/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/models/_models.py b/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/models/_models.py index 5ae44404e48..6f003305ab5 100644 --- a/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/models/_models.py +++ b/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/models/_models.py @@ -268,6 +268,36 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useles super().__init__(*args, **kwargs) +class FloatRequest(_model_base.Model): + """FloatRequest. + + All required parameters must be populated in order to send to server. + + :ivar temperature: Required. + :vartype temperature: float + """ + + temperature: float = rest_field() + """Required.""" + + @overload + def __init__( + self, + *, + temperature: float, + ): ... + + @overload + def __init__(self, mapping: Mapping[str, Any]): + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation + super().__init__(*args, **kwargs) + + class JsonPartRequest(_model_base.Model): """JsonPartRequest. diff --git a/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/operations/_operations.py index acf48ef3412..2378f96e00e 100644 --- a/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/operations/_operations.py @@ -47,7 +47,7 @@ def build_form_data_basic_request(**kwargs: Any) -> HttpRequest: return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) -def build_form_data_complex_request(**kwargs: Any) -> HttpRequest: +def build_form_data_file_array_and_basic_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) # Construct URL @@ -103,7 +103,18 @@ def build_form_data_anonymous_model_request(**kwargs: Any) -> HttpRequest: return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) -def build_form_data_file_with_http_part_specific_content_type_request( # pylint: disable=name-too-long +def build_form_data_http_parts_json_array_and_file_array_request( # pylint: disable=name-too-long + **kwargs: Any, +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + # Construct URL + _url = "/multipart/form-data/complex-parts-with-httppart" + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + +def build_form_data_http_parts_content_type_image_jpeg_content_type_request( # pylint: disable=name-too-long **kwargs: Any, ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -114,7 +125,7 @@ def build_form_data_file_with_http_part_specific_content_type_request( # pylint return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) -def build_form_data_file_with_http_part_required_content_type_request( # pylint: disable=name-too-long +def build_form_data_http_parts_content_type_required_content_type_request( # pylint: disable=name-too-long **kwargs: Any, ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -125,7 +136,7 @@ def build_form_data_file_with_http_part_required_content_type_request( # pylint return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) -def build_form_data_file_with_http_part_optional_content_type_request( # pylint: disable=name-too-long +def build_form_data_http_parts_content_type_optional_content_type_request( # pylint: disable=name-too-long **kwargs: Any, ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -136,11 +147,11 @@ def build_form_data_file_with_http_part_optional_content_type_request( # pylint return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) -def build_form_data_complex_with_http_part_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long +def build_form_data_http_parts_non_string_float_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) # Construct URL - _url = "/multipart/form-data/complex-parts-with-httppart" + _url = "/multipart/form-data/non-string-float" return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) @@ -162,6 +173,8 @@ def __init__(self, *args, **kwargs): self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + self.http_parts = FormDataHttpPartsOperations(self._client, self._config, self._serialize, self._deserialize) + @overload def basic( # pylint: disable=inconsistent-return-statements self, body: _models.MultiPartRequest, **kwargs: Any @@ -241,7 +254,7 @@ def basic( # pylint: disable=inconsistent-return-statements return cls(pipeline_response, None, {}) # type: ignore @overload - def complex( # pylint: disable=inconsistent-return-statements + def file_array_and_basic( # pylint: disable=inconsistent-return-statements self, body: _models.ComplexPartsRequest, **kwargs: Any ) -> None: """Test content-type: multipart/form-data for mixed scenarios. @@ -254,7 +267,7 @@ def complex( # pylint: disable=inconsistent-return-statements """ @overload - def complex(self, body: JSON, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + def file_array_and_basic(self, body: JSON, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements """Test content-type: multipart/form-data for mixed scenarios. :param body: Required. @@ -264,7 +277,7 @@ def complex(self, body: JSON, **kwargs: Any) -> None: # pylint: disable=inconsi :raises ~corehttp.exceptions.HttpResponseError: """ - def complex( # pylint: disable=inconsistent-return-statements + def file_array_and_basic( # pylint: disable=inconsistent-return-statements self, body: Union[_models.ComplexPartsRequest, JSON], **kwargs: Any ) -> None: """Test content-type: multipart/form-data for mixed scenarios. @@ -293,7 +306,7 @@ def complex( # pylint: disable=inconsistent-return-statements _data_fields: List[str] = ["id", "address"] _files, _data = prepare_multipart_form_data(_body, _file_fields, _data_fields) - _request = build_form_data_complex_request( + _request = build_form_data_file_array_and_basic_request( files=_files, data=_data, headers=_headers, @@ -717,8 +730,131 @@ def anonymous_model( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) # type: ignore + +class FormDataHttpPartsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~payload.multipart.MultiPartClient`'s + :attr:`http_parts` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + self.content_type = FormDataHttpPartsContentTypeOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.non_string = FormDataHttpPartsNonStringOperations( + self._client, self._config, self._serialize, self._deserialize + ) + + @overload + def json_array_and_file_array( # pylint: disable=inconsistent-return-statements + self, body: _models.ComplexHttpPartsModelRequest, **kwargs: Any + ) -> None: + """Test content-type: multipart/form-data for mixed scenarios. + + :param body: Required. + :type body: ~payload.multipart.models.ComplexHttpPartsModelRequest + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + @overload - def file_with_http_part_specific_content_type( # pylint: disable=inconsistent-return-statements,name-too-long + def json_array_and_file_array( # pylint: disable=inconsistent-return-statements + self, body: JSON, **kwargs: Any + ) -> None: + """Test content-type: multipart/form-data for mixed scenarios. + + :param body: Required. + :type body: JSON + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + + def json_array_and_file_array( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.ComplexHttpPartsModelRequest, JSON], **kwargs: Any + ) -> None: + """Test content-type: multipart/form-data for mixed scenarios. + + :param body: Is either a ComplexHttpPartsModelRequest type or a JSON type. Required. + :type body: ~payload.multipart.models.ComplexHttpPartsModelRequest or JSON + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _body = body.as_dict() if isinstance(body, _model_base.Model) else body + _file_fields: List[str] = ["profileImage", "pictures"] + _data_fields: List[str] = ["id", "address", "previousAddresses"] + _files, _data = prepare_multipart_form_data(_body, _file_fields, _data_fields) + + _request = build_form_data_http_parts_json_array_and_file_array_request( + files=_files, + data=_data, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class FormDataHttpPartsContentTypeOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~payload.multipart.MultiPartClient`'s + :attr:`content_type` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @overload + def image_jpeg_content_type( # pylint: disable=inconsistent-return-statements self, body: _models.FileWithHttpPartSpecificContentTypeRequest, **kwargs: Any ) -> None: """Test content-type: multipart/form-data. @@ -731,7 +867,7 @@ def file_with_http_part_specific_content_type( # pylint: disable=inconsistent-r """ @overload - def file_with_http_part_specific_content_type( # pylint: disable=inconsistent-return-statements,name-too-long + def image_jpeg_content_type( # pylint: disable=inconsistent-return-statements self, body: JSON, **kwargs: Any ) -> None: """Test content-type: multipart/form-data. @@ -743,7 +879,7 @@ def file_with_http_part_specific_content_type( # pylint: disable=inconsistent-r :raises ~corehttp.exceptions.HttpResponseError: """ - def file_with_http_part_specific_content_type( # pylint: disable=inconsistent-return-statements,name-too-long + def image_jpeg_content_type( # pylint: disable=inconsistent-return-statements self, body: Union[_models.FileWithHttpPartSpecificContentTypeRequest, JSON], **kwargs: Any ) -> None: """Test content-type: multipart/form-data. @@ -773,7 +909,7 @@ def file_with_http_part_specific_content_type( # pylint: disable=inconsistent-r _data_fields: List[str] = [] _files, _data = prepare_multipart_form_data(_body, _file_fields, _data_fields) - _request = build_form_data_file_with_http_part_specific_content_type_request( + _request = build_form_data_http_parts_content_type_image_jpeg_content_type_request( files=_files, data=_data, headers=_headers, @@ -799,7 +935,7 @@ def file_with_http_part_specific_content_type( # pylint: disable=inconsistent-r return cls(pipeline_response, None, {}) # type: ignore @overload - def file_with_http_part_required_content_type( # pylint: disable=inconsistent-return-statements,name-too-long + def required_content_type( # pylint: disable=inconsistent-return-statements self, body: _models.FileWithHttpPartRequiredContentTypeRequest, **kwargs: Any ) -> None: """Test content-type: multipart/form-data. @@ -812,7 +948,7 @@ def file_with_http_part_required_content_type( # pylint: disable=inconsistent-r """ @overload - def file_with_http_part_required_content_type( # pylint: disable=inconsistent-return-statements,name-too-long + def required_content_type( # pylint: disable=inconsistent-return-statements self, body: JSON, **kwargs: Any ) -> None: """Test content-type: multipart/form-data. @@ -824,7 +960,7 @@ def file_with_http_part_required_content_type( # pylint: disable=inconsistent-r :raises ~corehttp.exceptions.HttpResponseError: """ - def file_with_http_part_required_content_type( # pylint: disable=inconsistent-return-statements,name-too-long + def required_content_type( # pylint: disable=inconsistent-return-statements self, body: Union[_models.FileWithHttpPartRequiredContentTypeRequest, JSON], **kwargs: Any ) -> None: """Test content-type: multipart/form-data. @@ -854,7 +990,7 @@ def file_with_http_part_required_content_type( # pylint: disable=inconsistent-r _data_fields: List[str] = [] _files, _data = prepare_multipart_form_data(_body, _file_fields, _data_fields) - _request = build_form_data_file_with_http_part_required_content_type_request( + _request = build_form_data_http_parts_content_type_required_content_type_request( files=_files, data=_data, headers=_headers, @@ -880,7 +1016,7 @@ def file_with_http_part_required_content_type( # pylint: disable=inconsistent-r return cls(pipeline_response, None, {}) # type: ignore @overload - def file_with_http_part_optional_content_type( # pylint: disable=inconsistent-return-statements,name-too-long + def optional_content_type( # pylint: disable=inconsistent-return-statements self, body: _models.FileWithHttpPartOptionalContentTypeRequest, **kwargs: Any ) -> None: """Test content-type: multipart/form-data for optional content type. @@ -893,7 +1029,7 @@ def file_with_http_part_optional_content_type( # pylint: disable=inconsistent-r """ @overload - def file_with_http_part_optional_content_type( # pylint: disable=inconsistent-return-statements,name-too-long + def optional_content_type( # pylint: disable=inconsistent-return-statements self, body: JSON, **kwargs: Any ) -> None: """Test content-type: multipart/form-data for optional content type. @@ -905,7 +1041,7 @@ def file_with_http_part_optional_content_type( # pylint: disable=inconsistent-r :raises ~corehttp.exceptions.HttpResponseError: """ - def file_with_http_part_optional_content_type( # pylint: disable=inconsistent-return-statements,name-too-long + def optional_content_type( # pylint: disable=inconsistent-return-statements self, body: Union[_models.FileWithHttpPartOptionalContentTypeRequest, JSON], **kwargs: Any ) -> None: """Test content-type: multipart/form-data for optional content type. @@ -935,7 +1071,7 @@ def file_with_http_part_optional_content_type( # pylint: disable=inconsistent-r _data_fields: List[str] = [] _files, _data = prepare_multipart_form_data(_body, _file_fields, _data_fields) - _request = build_form_data_file_with_http_part_optional_content_type_request( + _request = build_form_data_http_parts_content_type_optional_content_type_request( files=_files, data=_data, headers=_headers, @@ -960,24 +1096,40 @@ def file_with_http_part_optional_content_type( # pylint: disable=inconsistent-r if cls: return cls(pipeline_response, None, {}) # type: ignore + +class FormDataHttpPartsNonStringOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~payload.multipart.MultiPartClient`'s + :attr:`non_string` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @overload - def complex_with_http_part( # pylint: disable=inconsistent-return-statements - self, body: _models.ComplexHttpPartsModelRequest, **kwargs: Any + def float( # pylint: disable=inconsistent-return-statements + self, body: _models.FloatRequest, **kwargs: Any ) -> None: - """Test content-type: multipart/form-data for mixed scenarios. + """Test content-type: multipart/form-data for non string. :param body: Required. - :type body: ~payload.multipart.models.ComplexHttpPartsModelRequest + :type body: ~payload.multipart.models.FloatRequest :return: None :rtype: None :raises ~corehttp.exceptions.HttpResponseError: """ @overload - def complex_with_http_part( # pylint: disable=inconsistent-return-statements - self, body: JSON, **kwargs: Any - ) -> None: - """Test content-type: multipart/form-data for mixed scenarios. + def float(self, body: JSON, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """Test content-type: multipart/form-data for non string. :param body: Required. :type body: JSON @@ -986,13 +1138,13 @@ def complex_with_http_part( # pylint: disable=inconsistent-return-statements :raises ~corehttp.exceptions.HttpResponseError: """ - def complex_with_http_part( # pylint: disable=inconsistent-return-statements - self, body: Union[_models.ComplexHttpPartsModelRequest, JSON], **kwargs: Any + def float( # pylint: disable=inconsistent-return-statements + self, body: Union[_models.FloatRequest, JSON], **kwargs: Any ) -> None: - """Test content-type: multipart/form-data for mixed scenarios. + """Test content-type: multipart/form-data for non string. - :param body: Is either a ComplexHttpPartsModelRequest type or a JSON type. Required. - :type body: ~payload.multipart.models.ComplexHttpPartsModelRequest or JSON + :param body: Is either a FloatRequest type or a JSON type. Required. + :type body: ~payload.multipart.models.FloatRequest or JSON :return: None :rtype: None :raises ~corehttp.exceptions.HttpResponseError: @@ -1011,11 +1163,11 @@ def complex_with_http_part( # pylint: disable=inconsistent-return-statements cls: ClsType[None] = kwargs.pop("cls", None) _body = body.as_dict() if isinstance(body, _model_base.Model) else body - _file_fields: List[str] = ["profileImage", "pictures"] - _data_fields: List[str] = ["id", "address", "previousAddresses"] + _file_fields: List[str] = [] + _data_fields: List[str] = ["temperature"] _files, _data = prepare_multipart_form_data(_body, _file_fields, _data_fields) - _request = build_form_data_complex_with_http_part_request( + _request = build_form_data_http_parts_non_string_float_request( files=_files, data=_data, headers=_headers, diff --git a/packages/typespec-python/test/unbranded/generated/routes/CHANGELOG.md b/packages/typespec-python/test/unbranded/generated/routes/CHANGELOG.md new file mode 100644 index 00000000000..628743d283a --- /dev/null +++ b/packages/typespec-python/test/unbranded/generated/routes/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0b1 (1970-01-01) + +- Initial version diff --git a/packages/typespec-python/test/unbranded/generated/routes/LICENSE b/packages/typespec-python/test/unbranded/generated/routes/LICENSE new file mode 100644 index 00000000000..edd3f78edcc --- /dev/null +++ b/packages/typespec-python/test/unbranded/generated/routes/LICENSE @@ -0,0 +1,21 @@ +Copyright (c) Unbranded Corporation. + +MIT License + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/packages/typespec-python/test/unbranded/generated/routes/MANIFEST.in b/packages/typespec-python/test/unbranded/generated/routes/MANIFEST.in new file mode 100644 index 00000000000..d3777f92f7f --- /dev/null +++ b/packages/typespec-python/test/unbranded/generated/routes/MANIFEST.in @@ -0,0 +1,5 @@ +include *.md +include LICENSE +include routes/py.typed +recursive-include tests *.py +recursive-include samples *.py *.md \ No newline at end of file diff --git a/packages/typespec-python/test/unbranded/generated/routes/README.md b/packages/typespec-python/test/unbranded/generated/routes/README.md new file mode 100644 index 00000000000..e69de29bb2d diff --git a/packages/typespec-python/test/unbranded/generated/routes/routes/__init__.py b/packages/typespec-python/test/unbranded/generated/routes/routes/__init__.py new file mode 100644 index 00000000000..5a7002038e1 --- /dev/null +++ b/packages/typespec-python/test/unbranded/generated/routes/routes/__init__.py @@ -0,0 +1,26 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Unbranded Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Unbranded (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._client import RoutesClient +from ._version import VERSION + +__version__ = VERSION + +try: + from ._patch import __all__ as _patch_all + from ._patch import * # pylint: disable=unused-wildcard-import +except ImportError: + _patch_all = [] +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "RoutesClient", +] +__all__.extend([p for p in _patch_all if p not in __all__]) + +_patch_sdk() diff --git a/packages/typespec-python/test/unbranded/generated/routes/routes/_client.py b/packages/typespec-python/test/unbranded/generated/routes/routes/_client.py new file mode 100644 index 00000000000..cf9cdb5d261 --- /dev/null +++ b/packages/typespec-python/test/unbranded/generated/routes/routes/_client.py @@ -0,0 +1,100 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Unbranded Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Unbranded (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from copy import deepcopy +from typing import Any +from typing_extensions import Self + +from corehttp.rest import HttpRequest, HttpResponse +from corehttp.runtime import PipelineClient, policies + +from ._configuration import RoutesClientConfiguration +from ._serialization import Deserializer, Serializer +from .operations import ( + InInterfaceOperations, + PathParametersOperations, + QueryParametersOperations, + RoutesClientOperationsMixin, +) + + +class RoutesClient(RoutesClientOperationsMixin): # pylint: disable=client-accepts-api-version-keyword + """Define scenario in building the http route/uri. + + :ivar path_parameters: PathParametersOperations operations + :vartype path_parameters: routes.operations.PathParametersOperations + :ivar query_parameters: QueryParametersOperations operations + :vartype query_parameters: routes.operations.QueryParametersOperations + :ivar in_interface: InInterfaceOperations operations + :vartype in_interface: routes.operations.InInterfaceOperations + :keyword endpoint: Service host. Default value is "http://localhost:3000". + :paramtype endpoint: str + """ + + def __init__( # pylint: disable=missing-client-constructor-parameter-credential + self, *, endpoint: str = "http://localhost:3000", **kwargs: Any + ) -> None: + _endpoint = "{endpoint}" + self._config = RoutesClientConfiguration(endpoint=endpoint, **kwargs) + _policies = kwargs.pop("policies", None) + if _policies is None: + _policies = [ + self._config.headers_policy, + self._config.user_agent_policy, + self._config.proxy_policy, + policies.ContentDecodePolicy(**kwargs), + self._config.retry_policy, + self._config.authentication_policy, + self._config.logging_policy, + ] + self._client: PipelineClient = PipelineClient(endpoint=_endpoint, policies=_policies, **kwargs) + + self._serialize = Serializer() + self._deserialize = Deserializer() + self._serialize.client_side_validation = False + self.path_parameters = PathParametersOperations(self._client, self._config, self._serialize, self._deserialize) + self.query_parameters = QueryParametersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.in_interface = InInterfaceOperations(self._client, self._config, self._serialize, self._deserialize) + + def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: + """Runs the network request through the client's chained policies. + + >>> from corehttp.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = client.send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request + + :param request: The network request you want to make. Required. + :type request: ~corehttp.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~corehttp.rest.HttpResponse + """ + + request_copy = deepcopy(request) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + + request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) + return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore + + def close(self) -> None: + self._client.close() + + def __enter__(self) -> Self: + self._client.__enter__() + return self + + def __exit__(self, *exc_details: Any) -> None: + self._client.__exit__(*exc_details) diff --git a/packages/typespec-python/test/unbranded/generated/routes/routes/_configuration.py b/packages/typespec-python/test/unbranded/generated/routes/routes/_configuration.py new file mode 100644 index 00000000000..36664c91da2 --- /dev/null +++ b/packages/typespec-python/test/unbranded/generated/routes/routes/_configuration.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Unbranded Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Unbranded (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any + +from corehttp.runtime import policies + +from ._version import VERSION + + +class RoutesClientConfiguration: # pylint: disable=too-many-instance-attributes + """Configuration for RoutesClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param endpoint: Service host. Default value is "http://localhost:3000". + :type endpoint: str + """ + + def __init__(self, endpoint: str = "http://localhost:3000", **kwargs: Any) -> None: + + self.endpoint = endpoint + kwargs.setdefault("sdk_moniker", "routes/{}".format(VERSION)) + self.polling_interval = kwargs.get("polling_interval", 30) + self._configure(**kwargs) + + def _configure(self, **kwargs: Any) -> None: + self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") diff --git a/packages/typespec-python/test/unbranded/generated/routes/routes/_model_base.py b/packages/typespec-python/test/unbranded/generated/routes/routes/_model_base.py new file mode 100644 index 00000000000..d7104eeb8c7 --- /dev/null +++ b/packages/typespec-python/test/unbranded/generated/routes/routes/_model_base.py @@ -0,0 +1,901 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Unbranded Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# -------------------------------------------------------------------------- +# pylint: disable=protected-access, arguments-differ, signature-differs, broad-except + +import copy +import calendar +import decimal +import functools +import sys +import logging +import base64 +import re +import typing +import enum +import email.utils +from datetime import datetime, date, time, timedelta, timezone +from json import JSONEncoder +from typing_extensions import Self +import isodate +from corehttp.exceptions import DeserializationError +from corehttp.utils import CaseInsensitiveEnumMeta +from corehttp.runtime.pipeline import PipelineResponse +from corehttp.serialization import _Null + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping + +_LOGGER = logging.getLogger(__name__) + +__all__ = ["SdkJSONEncoder", "Model", "rest_field", "rest_discriminator"] + +TZ_UTC = timezone.utc +_T = typing.TypeVar("_T") + + +def _timedelta_as_isostr(td: timedelta) -> str: + """Converts a datetime.timedelta object into an ISO 8601 formatted string, e.g. 'P4DT12H30M05S' + + Function adapted from the Tin Can Python project: https://github.com/RusticiSoftware/TinCanPython + + :param timedelta td: The timedelta to convert + :rtype: str + :return: ISO8601 version of this timedelta + """ + + # Split seconds to larger units + seconds = td.total_seconds() + minutes, seconds = divmod(seconds, 60) + hours, minutes = divmod(minutes, 60) + days, hours = divmod(hours, 24) + + days, hours, minutes = list(map(int, (days, hours, minutes))) + seconds = round(seconds, 6) + + # Build date + date_str = "" + if days: + date_str = "%sD" % days + + if hours or minutes or seconds: + # Build time + time_str = "T" + + # Hours + bigger_exists = date_str or hours + if bigger_exists: + time_str += "{:02}H".format(hours) + + # Minutes + bigger_exists = bigger_exists or minutes + if bigger_exists: + time_str += "{:02}M".format(minutes) + + # Seconds + try: + if seconds.is_integer(): + seconds_string = "{:02}".format(int(seconds)) + else: + # 9 chars long w/ leading 0, 6 digits after decimal + seconds_string = "%09.6f" % seconds + # Remove trailing zeros + seconds_string = seconds_string.rstrip("0") + except AttributeError: # int.is_integer() raises + seconds_string = "{:02}".format(seconds) + + time_str += "{}S".format(seconds_string) + else: + time_str = "" + + return "P" + date_str + time_str + + +def _serialize_bytes(o, format: typing.Optional[str] = None) -> str: + encoded = base64.b64encode(o).decode() + if format == "base64url": + return encoded.strip("=").replace("+", "-").replace("/", "_") + return encoded + + +def _serialize_datetime(o, format: typing.Optional[str] = None): + if hasattr(o, "year") and hasattr(o, "hour"): + if format == "rfc7231": + return email.utils.format_datetime(o, usegmt=True) + if format == "unix-timestamp": + return int(calendar.timegm(o.utctimetuple())) + + # astimezone() fails for naive times in Python 2.7, so make make sure o is aware (tzinfo is set) + if not o.tzinfo: + iso_formatted = o.replace(tzinfo=TZ_UTC).isoformat() + else: + iso_formatted = o.astimezone(TZ_UTC).isoformat() + # Replace the trailing "+00:00" UTC offset with "Z" (RFC 3339: https://www.ietf.org/rfc/rfc3339.txt) + return iso_formatted.replace("+00:00", "Z") + # Next try datetime.date or datetime.time + return o.isoformat() + + +def _is_readonly(p): + try: + return p._visibility == ["read"] # pylint: disable=protected-access + except AttributeError: + return False + + +class SdkJSONEncoder(JSONEncoder): + """A JSON encoder that's capable of serializing datetime objects and bytes.""" + + def __init__(self, *args, exclude_readonly: bool = False, format: typing.Optional[str] = None, **kwargs): + super().__init__(*args, **kwargs) + self.exclude_readonly = exclude_readonly + self.format = format + + def default(self, o): # pylint: disable=too-many-return-statements + if _is_model(o): + if self.exclude_readonly: + readonly_props = [p._rest_name for p in o._attr_to_rest_field.values() if _is_readonly(p)] + return {k: v for k, v in o.items() if k not in readonly_props} + return dict(o.items()) + try: + return super(SdkJSONEncoder, self).default(o) + except TypeError: + if isinstance(o, _Null): + return None + if isinstance(o, decimal.Decimal): + return float(o) + if isinstance(o, (bytes, bytearray)): + return _serialize_bytes(o, self.format) + try: + # First try datetime.datetime + return _serialize_datetime(o, self.format) + except AttributeError: + pass + # Last, try datetime.timedelta + try: + return _timedelta_as_isostr(o) + except AttributeError: + # This will be raised when it hits value.total_seconds in the method above + pass + return super(SdkJSONEncoder, self).default(o) + + +_VALID_DATE = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}" + r"\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") +_VALID_RFC7231 = re.compile( + r"(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s\d{2}\s" + r"(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s\d{4}\s\d{2}:\d{2}:\d{2}\sGMT" +) + + +def _deserialize_datetime(attr: typing.Union[str, datetime]) -> datetime: + """Deserialize ISO-8601 formatted string into Datetime object. + + :param str attr: response string to be deserialized. + :rtype: ~datetime.datetime + :returns: The datetime object from that input + """ + if isinstance(attr, datetime): + # i'm already deserialized + return attr + attr = attr.upper() + match = _VALID_DATE.match(attr) + if not match: + raise ValueError("Invalid datetime string: " + attr) + + check_decimal = attr.split(".") + if len(check_decimal) > 1: + decimal_str = "" + for digit in check_decimal[1]: + if digit.isdigit(): + decimal_str += digit + else: + break + if len(decimal_str) > 6: + attr = attr.replace(decimal_str, decimal_str[0:6]) + + date_obj = isodate.parse_datetime(attr) + test_utc = date_obj.utctimetuple() + if test_utc.tm_year > 9999 or test_utc.tm_year < 1: + raise OverflowError("Hit max or min date") + return date_obj + + +def _deserialize_datetime_rfc7231(attr: typing.Union[str, datetime]) -> datetime: + """Deserialize RFC7231 formatted string into Datetime object. + + :param str attr: response string to be deserialized. + :rtype: ~datetime.datetime + :returns: The datetime object from that input + """ + if isinstance(attr, datetime): + # i'm already deserialized + return attr + match = _VALID_RFC7231.match(attr) + if not match: + raise ValueError("Invalid datetime string: " + attr) + + return email.utils.parsedate_to_datetime(attr) + + +def _deserialize_datetime_unix_timestamp(attr: typing.Union[float, datetime]) -> datetime: + """Deserialize unix timestamp into Datetime object. + + :param str attr: response string to be deserialized. + :rtype: ~datetime.datetime + :returns: The datetime object from that input + """ + if isinstance(attr, datetime): + # i'm already deserialized + return attr + return datetime.fromtimestamp(attr, TZ_UTC) + + +def _deserialize_date(attr: typing.Union[str, date]) -> date: + """Deserialize ISO-8601 formatted string into Date object. + :param str attr: response string to be deserialized. + :rtype: date + :returns: The date object from that input + """ + # This must NOT use defaultmonth/defaultday. Using None ensure this raises an exception. + if isinstance(attr, date): + return attr + return isodate.parse_date(attr, defaultmonth=None, defaultday=None) # type: ignore + + +def _deserialize_time(attr: typing.Union[str, time]) -> time: + """Deserialize ISO-8601 formatted string into time object. + + :param str attr: response string to be deserialized. + :rtype: datetime.time + :returns: The time object from that input + """ + if isinstance(attr, time): + return attr + return isodate.parse_time(attr) + + +def _deserialize_bytes(attr): + if isinstance(attr, (bytes, bytearray)): + return attr + return bytes(base64.b64decode(attr)) + + +def _deserialize_bytes_base64(attr): + if isinstance(attr, (bytes, bytearray)): + return attr + padding = "=" * (3 - (len(attr) + 3) % 4) # type: ignore + attr = attr + padding # type: ignore + encoded = attr.replace("-", "+").replace("_", "/") + return bytes(base64.b64decode(encoded)) + + +def _deserialize_duration(attr): + if isinstance(attr, timedelta): + return attr + return isodate.parse_duration(attr) + + +def _deserialize_decimal(attr): + if isinstance(attr, decimal.Decimal): + return attr + return decimal.Decimal(str(attr)) + + +_DESERIALIZE_MAPPING = { + datetime: _deserialize_datetime, + date: _deserialize_date, + time: _deserialize_time, + bytes: _deserialize_bytes, + bytearray: _deserialize_bytes, + timedelta: _deserialize_duration, + typing.Any: lambda x: x, + decimal.Decimal: _deserialize_decimal, +} + +_DESERIALIZE_MAPPING_WITHFORMAT = { + "rfc3339": _deserialize_datetime, + "rfc7231": _deserialize_datetime_rfc7231, + "unix-timestamp": _deserialize_datetime_unix_timestamp, + "base64": _deserialize_bytes, + "base64url": _deserialize_bytes_base64, +} + + +def get_deserializer(annotation: typing.Any, rf: typing.Optional["_RestField"] = None): + if rf and rf._format: + return _DESERIALIZE_MAPPING_WITHFORMAT.get(rf._format) + return _DESERIALIZE_MAPPING.get(annotation) + + +def _get_type_alias_type(module_name: str, alias_name: str): + types = { + k: v + for k, v in sys.modules[module_name].__dict__.items() + if isinstance(v, typing._GenericAlias) # type: ignore + } + if alias_name not in types: + return alias_name + return types[alias_name] + + +def _get_model(module_name: str, model_name: str): + models = {k: v for k, v in sys.modules[module_name].__dict__.items() if isinstance(v, type)} + module_end = module_name.rsplit(".", 1)[0] + models.update({k: v for k, v in sys.modules[module_end].__dict__.items() if isinstance(v, type)}) + if isinstance(model_name, str): + model_name = model_name.split(".")[-1] + if model_name not in models: + return model_name + return models[model_name] + + +_UNSET = object() + + +class _MyMutableMapping(MutableMapping[str, typing.Any]): # pylint: disable=unsubscriptable-object + def __init__(self, data: typing.Dict[str, typing.Any]) -> None: + self._data = data + + def __contains__(self, key: typing.Any) -> bool: + return key in self._data + + def __getitem__(self, key: str) -> typing.Any: + return self._data.__getitem__(key) + + def __setitem__(self, key: str, value: typing.Any) -> None: + self._data.__setitem__(key, value) + + def __delitem__(self, key: str) -> None: + self._data.__delitem__(key) + + def __iter__(self) -> typing.Iterator[typing.Any]: + return self._data.__iter__() + + def __len__(self) -> int: + return self._data.__len__() + + def __ne__(self, other: typing.Any) -> bool: + return not self.__eq__(other) + + def keys(self) -> typing.KeysView[str]: + return self._data.keys() + + def values(self) -> typing.ValuesView[typing.Any]: + return self._data.values() + + def items(self) -> typing.ItemsView[str, typing.Any]: + return self._data.items() + + def get(self, key: str, default: typing.Any = None) -> typing.Any: + try: + return self[key] + except KeyError: + return default + + @typing.overload + def pop(self, key: str) -> typing.Any: ... + + @typing.overload + def pop(self, key: str, default: _T) -> _T: ... + + @typing.overload + def pop(self, key: str, default: typing.Any) -> typing.Any: ... + + def pop(self, key: str, default: typing.Any = _UNSET) -> typing.Any: + if default is _UNSET: + return self._data.pop(key) + return self._data.pop(key, default) + + def popitem(self) -> typing.Tuple[str, typing.Any]: + return self._data.popitem() + + def clear(self) -> None: + self._data.clear() + + def update(self, *args: typing.Any, **kwargs: typing.Any) -> None: + self._data.update(*args, **kwargs) + + @typing.overload + def setdefault(self, key: str, default: None = None) -> None: ... + + @typing.overload + def setdefault(self, key: str, default: typing.Any) -> typing.Any: ... + + def setdefault(self, key: str, default: typing.Any = _UNSET) -> typing.Any: + if default is _UNSET: + return self._data.setdefault(key) + return self._data.setdefault(key, default) + + def __eq__(self, other: typing.Any) -> bool: + try: + other_model = self.__class__(other) + except Exception: + return False + return self._data == other_model._data + + def __repr__(self) -> str: + return str(self._data) + + +def _is_model(obj: typing.Any) -> bool: + return getattr(obj, "_is_model", False) + + +def _serialize(o, format: typing.Optional[str] = None): # pylint: disable=too-many-return-statements + if isinstance(o, list): + return [_serialize(x, format) for x in o] + if isinstance(o, dict): + return {k: _serialize(v, format) for k, v in o.items()} + if isinstance(o, set): + return {_serialize(x, format) for x in o} + if isinstance(o, tuple): + return tuple(_serialize(x, format) for x in o) + if isinstance(o, (bytes, bytearray)): + return _serialize_bytes(o, format) + if isinstance(o, decimal.Decimal): + return float(o) + if isinstance(o, enum.Enum): + return o.value + if isinstance(o, int): + if format == "str": + return str(o) + return o + try: + # First try datetime.datetime + return _serialize_datetime(o, format) + except AttributeError: + pass + # Last, try datetime.timedelta + try: + return _timedelta_as_isostr(o) + except AttributeError: + # This will be raised when it hits value.total_seconds in the method above + pass + return o + + +def _get_rest_field( + attr_to_rest_field: typing.Dict[str, "_RestField"], rest_name: str +) -> typing.Optional["_RestField"]: + try: + return next(rf for rf in attr_to_rest_field.values() if rf._rest_name == rest_name) + except StopIteration: + return None + + +def _create_value(rf: typing.Optional["_RestField"], value: typing.Any) -> typing.Any: + if not rf: + return _serialize(value, None) + if rf._is_multipart_file_input: + return value + if rf._is_model: + return _deserialize(rf._type, value) + return _serialize(value, rf._format) + + +class Model(_MyMutableMapping): + _is_model = True + # label whether current class's _attr_to_rest_field has been calculated + # could not see _attr_to_rest_field directly because subclass inherits it from parent class + _calculated: typing.Set[str] = set() + + def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None: + class_name = self.__class__.__name__ + if len(args) > 1: + raise TypeError(f"{class_name}.__init__() takes 2 positional arguments but {len(args) + 1} were given") + dict_to_pass = { + rest_field._rest_name: rest_field._default + for rest_field in self._attr_to_rest_field.values() + if rest_field._default is not _UNSET + } + if args: + dict_to_pass.update( + {k: _create_value(_get_rest_field(self._attr_to_rest_field, k), v) for k, v in args[0].items()} + ) + else: + non_attr_kwargs = [k for k in kwargs if k not in self._attr_to_rest_field] + if non_attr_kwargs: + # actual type errors only throw the first wrong keyword arg they see, so following that. + raise TypeError(f"{class_name}.__init__() got an unexpected keyword argument '{non_attr_kwargs[0]}'") + dict_to_pass.update( + { + self._attr_to_rest_field[k]._rest_name: _create_value(self._attr_to_rest_field[k], v) + for k, v in kwargs.items() + if v is not None + } + ) + super().__init__(dict_to_pass) + + def copy(self) -> "Model": + return Model(self.__dict__) + + def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: # pylint: disable=unused-argument + if f"{cls.__module__}.{cls.__qualname__}" not in cls._calculated: + # we know the last nine classes in mro are going to be 'Model', '_MyMutableMapping', 'MutableMapping', + # 'Mapping', 'Collection', 'Sized', 'Iterable', 'Container' and 'object' + mros = cls.__mro__[:-9][::-1] # ignore parents, and reverse the mro order + attr_to_rest_field: typing.Dict[str, _RestField] = { # map attribute name to rest_field property + k: v for mro_class in mros for k, v in mro_class.__dict__.items() if k[0] != "_" and hasattr(v, "_type") + } + annotations = { + k: v + for mro_class in mros + if hasattr(mro_class, "__annotations__") # pylint: disable=no-member + for k, v in mro_class.__annotations__.items() # pylint: disable=no-member + } + for attr, rf in attr_to_rest_field.items(): + rf._module = cls.__module__ + if not rf._type: + rf._type = rf._get_deserialize_callable_from_annotation(annotations.get(attr, None)) + if not rf._rest_name_input: + rf._rest_name_input = attr + cls._attr_to_rest_field: typing.Dict[str, _RestField] = dict(attr_to_rest_field.items()) + cls._calculated.add(f"{cls.__module__}.{cls.__qualname__}") + + return super().__new__(cls) # pylint: disable=no-value-for-parameter + + def __init_subclass__(cls, discriminator: typing.Optional[str] = None) -> None: + for base in cls.__bases__: + if hasattr(base, "__mapping__"): # pylint: disable=no-member + base.__mapping__[discriminator or cls.__name__] = cls # type: ignore # pylint: disable=no-member + + @classmethod + def _get_discriminator(cls, exist_discriminators) -> typing.Optional[str]: + for v in cls.__dict__.values(): + if ( + isinstance(v, _RestField) and v._is_discriminator and v._rest_name not in exist_discriminators + ): # pylint: disable=protected-access + return v._rest_name # pylint: disable=protected-access + return None + + @classmethod + def _deserialize(cls, data, exist_discriminators): + if not hasattr(cls, "__mapping__"): # pylint: disable=no-member + return cls(data) + discriminator = cls._get_discriminator(exist_discriminators) + exist_discriminators.append(discriminator) + mapped_cls = cls.__mapping__.get(data.get(discriminator), cls) # pyright: ignore # pylint: disable=no-member + if mapped_cls == cls: + return cls(data) + return mapped_cls._deserialize(data, exist_discriminators) # pylint: disable=protected-access + + def as_dict(self, *, exclude_readonly: bool = False) -> typing.Dict[str, typing.Any]: + """Return a dict that can be JSONify using json.dump. + + :keyword bool exclude_readonly: Whether to remove the readonly properties. + :returns: A dict JSON compatible object + :rtype: dict + """ + + result = {} + readonly_props = [] + if exclude_readonly: + readonly_props = [p._rest_name for p in self._attr_to_rest_field.values() if _is_readonly(p)] + for k, v in self.items(): + if exclude_readonly and k in readonly_props: # pyright: ignore + continue + is_multipart_file_input = False + try: + is_multipart_file_input = next( + rf for rf in self._attr_to_rest_field.values() if rf._rest_name == k + )._is_multipart_file_input + except StopIteration: + pass + result[k] = v if is_multipart_file_input else Model._as_dict_value(v, exclude_readonly=exclude_readonly) + return result + + @staticmethod + def _as_dict_value(v: typing.Any, exclude_readonly: bool = False) -> typing.Any: + if v is None or isinstance(v, _Null): + return None + if isinstance(v, (list, tuple, set)): + return type(v)(Model._as_dict_value(x, exclude_readonly=exclude_readonly) for x in v) + if isinstance(v, dict): + return {dk: Model._as_dict_value(dv, exclude_readonly=exclude_readonly) for dk, dv in v.items()} + return v.as_dict(exclude_readonly=exclude_readonly) if hasattr(v, "as_dict") else v + + +def _deserialize_model(model_deserializer: typing.Optional[typing.Callable], obj): + if _is_model(obj): + return obj + return _deserialize(model_deserializer, obj) + + +def _deserialize_with_optional(if_obj_deserializer: typing.Optional[typing.Callable], obj): + if obj is None: + return obj + return _deserialize_with_callable(if_obj_deserializer, obj) + + +def _deserialize_with_union(deserializers, obj): + for deserializer in deserializers: + try: + return _deserialize(deserializer, obj) + except DeserializationError: + pass + raise DeserializationError() + + +def _deserialize_dict( + value_deserializer: typing.Optional[typing.Callable], + module: typing.Optional[str], + obj: typing.Dict[typing.Any, typing.Any], +): + if obj is None: + return obj + return {k: _deserialize(value_deserializer, v, module) for k, v in obj.items()} + + +def _deserialize_multiple_sequence( + entry_deserializers: typing.List[typing.Optional[typing.Callable]], + module: typing.Optional[str], + obj, +): + if obj is None: + return obj + return type(obj)(_deserialize(deserializer, entry, module) for entry, deserializer in zip(obj, entry_deserializers)) + + +def _deserialize_sequence( + deserializer: typing.Optional[typing.Callable], + module: typing.Optional[str], + obj, +): + if obj is None: + return obj + return type(obj)(_deserialize(deserializer, entry, module) for entry in obj) + + +def _sorted_annotations(types: typing.List[typing.Any]) -> typing.List[typing.Any]: + return sorted( + types, + key=lambda x: hasattr(x, "__name__") and x.__name__.lower() in ("str", "float", "int", "bool"), + ) + + +def _get_deserialize_callable_from_annotation( # pylint: disable=R0911, R0915, R0912 + annotation: typing.Any, + module: typing.Optional[str], + rf: typing.Optional["_RestField"] = None, +) -> typing.Optional[typing.Callable[[typing.Any], typing.Any]]: + if not annotation or annotation in [int, float]: + if annotation is int and rf and rf._format == "str": + return int + return None + + # is it a type alias? + if isinstance(annotation, str): + if module is not None: + annotation = _get_type_alias_type(module, annotation) + + # is it a forward ref / in quotes? + if isinstance(annotation, (str, typing.ForwardRef)): + try: + model_name = annotation.__forward_arg__ # type: ignore + except AttributeError: + model_name = annotation + if module is not None: + annotation = _get_model(module, model_name) + + try: + if module and _is_model(annotation): + if rf: + rf._is_model = True + + return functools.partial(_deserialize_model, annotation) # pyright: ignore + except Exception: + pass + + # is it a literal? + try: + if annotation.__origin__ is typing.Literal: # pyright: ignore + return None + except AttributeError: + pass + + # is it optional? + try: + if any(a for a in annotation.__args__ if a == type(None)): # pyright: ignore + if len(annotation.__args__) <= 2: # pyright: ignore + if_obj_deserializer = _get_deserialize_callable_from_annotation( + next(a for a in annotation.__args__ if a != type(None)), module, rf # pyright: ignore + ) + + return functools.partial(_deserialize_with_optional, if_obj_deserializer) + # the type is Optional[Union[...]], we need to remove the None type from the Union + annotation_copy = copy.copy(annotation) + annotation_copy.__args__ = [a for a in annotation_copy.__args__ if a != type(None)] # pyright: ignore + return _get_deserialize_callable_from_annotation(annotation_copy, module, rf) + except AttributeError: + pass + + # is it union? + if getattr(annotation, "__origin__", None) is typing.Union: + # initial ordering is we make `string` the last deserialization option, because it is often them most generic + deserializers = [ + _get_deserialize_callable_from_annotation(arg, module, rf) + for arg in _sorted_annotations(annotation.__args__) # pyright: ignore + ] + + return functools.partial(_deserialize_with_union, deserializers) + + try: + if annotation._name == "Dict": # pyright: ignore + value_deserializer = _get_deserialize_callable_from_annotation( + annotation.__args__[1], module, rf # pyright: ignore + ) + + return functools.partial( + _deserialize_dict, + value_deserializer, + module, + ) + except (AttributeError, IndexError): + pass + try: + if annotation._name in ["List", "Set", "Tuple", "Sequence"]: # pyright: ignore + if len(annotation.__args__) > 1: # pyright: ignore + + entry_deserializers = [ + _get_deserialize_callable_from_annotation(dt, module, rf) + for dt in annotation.__args__ # pyright: ignore + ] + return functools.partial(_deserialize_multiple_sequence, entry_deserializers, module) + deserializer = _get_deserialize_callable_from_annotation( + annotation.__args__[0], module, rf # pyright: ignore + ) + + return functools.partial(_deserialize_sequence, deserializer, module) + except (TypeError, IndexError, AttributeError, SyntaxError): + pass + + def _deserialize_default( + deserializer, + obj, + ): + if obj is None: + return obj + try: + return _deserialize_with_callable(deserializer, obj) + except Exception: + pass + return obj + + if get_deserializer(annotation, rf): + return functools.partial(_deserialize_default, get_deserializer(annotation, rf)) + + return functools.partial(_deserialize_default, annotation) + + +def _deserialize_with_callable( + deserializer: typing.Optional[typing.Callable[[typing.Any], typing.Any]], + value: typing.Any, +): + try: + if value is None or isinstance(value, _Null): + return None + if deserializer is None: + return value + if isinstance(deserializer, CaseInsensitiveEnumMeta): + try: + return deserializer(value) + except ValueError: + # for unknown value, return raw value + return value + if isinstance(deserializer, type) and issubclass(deserializer, Model): + return deserializer._deserialize(value, []) + return typing.cast(typing.Callable[[typing.Any], typing.Any], deserializer)(value) + except Exception as e: + raise DeserializationError() from e + + +def _deserialize( + deserializer: typing.Any, + value: typing.Any, + module: typing.Optional[str] = None, + rf: typing.Optional["_RestField"] = None, + format: typing.Optional[str] = None, +) -> typing.Any: + if isinstance(value, PipelineResponse): + value = value.http_response.json() + if rf is None and format: + rf = _RestField(format=format) + if not isinstance(deserializer, functools.partial): + deserializer = _get_deserialize_callable_from_annotation(deserializer, module, rf) + return _deserialize_with_callable(deserializer, value) + + +class _RestField: + def __init__( + self, + *, + name: typing.Optional[str] = None, + type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin + is_discriminator: bool = False, + visibility: typing.Optional[typing.List[str]] = None, + default: typing.Any = _UNSET, + format: typing.Optional[str] = None, + is_multipart_file_input: bool = False, + ): + self._type = type + self._rest_name_input = name + self._module: typing.Optional[str] = None + self._is_discriminator = is_discriminator + self._visibility = visibility + self._is_model = False + self._default = default + self._format = format + self._is_multipart_file_input = is_multipart_file_input + + @property + def _class_type(self) -> typing.Any: + return getattr(self._type, "args", [None])[0] + + @property + def _rest_name(self) -> str: + if self._rest_name_input is None: + raise ValueError("Rest name was never set") + return self._rest_name_input + + def __get__(self, obj: Model, type=None): # pylint: disable=redefined-builtin + # by this point, type and rest_name will have a value bc we default + # them in __new__ of the Model class + item = obj.get(self._rest_name) + if item is None: + return item + if self._is_model: + return item + return _deserialize(self._type, _serialize(item, self._format), rf=self) + + def __set__(self, obj: Model, value) -> None: + if value is None: + # we want to wipe out entries if users set attr to None + try: + obj.__delitem__(self._rest_name) + except KeyError: + pass + return + if self._is_model: + if not _is_model(value): + value = _deserialize(self._type, value) + obj.__setitem__(self._rest_name, value) + return + obj.__setitem__(self._rest_name, _serialize(value, self._format)) + + def _get_deserialize_callable_from_annotation( + self, annotation: typing.Any + ) -> typing.Optional[typing.Callable[[typing.Any], typing.Any]]: + return _get_deserialize_callable_from_annotation(annotation, self._module, self) + + +def rest_field( + *, + name: typing.Optional[str] = None, + type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin + visibility: typing.Optional[typing.List[str]] = None, + default: typing.Any = _UNSET, + format: typing.Optional[str] = None, + is_multipart_file_input: bool = False, +) -> typing.Any: + return _RestField( + name=name, + type=type, + visibility=visibility, + default=default, + format=format, + is_multipart_file_input=is_multipart_file_input, + ) + + +def rest_discriminator( + *, + name: typing.Optional[str] = None, + type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin + visibility: typing.Optional[typing.List[str]] = None, +) -> typing.Any: + return _RestField(name=name, type=type, is_discriminator=True, visibility=visibility) diff --git a/packages/typespec-python/test/unbranded/generated/routes/routes/_patch.py b/packages/typespec-python/test/unbranded/generated/routes/routes/_patch.py new file mode 100644 index 00000000000..cc9d8be1c50 --- /dev/null +++ b/packages/typespec-python/test/unbranded/generated/routes/routes/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Unbranded Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/unbranded/generated/routes/routes/_serialization.py b/packages/typespec-python/test/unbranded/generated/routes/routes/_serialization.py new file mode 100644 index 00000000000..3ef87d7b1ce --- /dev/null +++ b/packages/typespec-python/test/unbranded/generated/routes/routes/_serialization.py @@ -0,0 +1,2115 @@ +# pylint: disable=too-many-lines +# -------------------------------------------------------------------------- +# +# Copyright (c) Unbranded Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# pyright: reportUnnecessaryTypeIgnoreComment=false + +from base64 import b64decode, b64encode +import calendar +import datetime +import decimal +import email +from enum import Enum +import json +import logging +import re +import sys +import codecs +from typing import ( + Dict, + Any, + cast, + Optional, + Union, + AnyStr, + IO, + Mapping, + Callable, + TypeVar, + MutableMapping, + Type, + List, +) + +try: + from urllib import quote # type: ignore +except ImportError: + from urllib.parse import quote +import xml.etree.ElementTree as ET + +import isodate # type: ignore + +from corehttp.exceptions import DeserializationError, SerializationError +from corehttp.serialization import NULL as CoreNull + +_BOM = codecs.BOM_UTF8.decode(encoding="utf-8") + +ModelType = TypeVar("ModelType", bound="Model") +JSON = MutableMapping[str, Any] + + +class RawDeserializer: + + # Accept "text" because we're open minded people... + JSON_REGEXP = re.compile(r"^(application|text)/([a-z+.]+\+)?json$") + + # Name used in context + CONTEXT_NAME = "deserialized_data" + + @classmethod + def deserialize_from_text(cls, data: Optional[Union[AnyStr, IO]], content_type: Optional[str] = None) -> Any: + """Decode data according to content-type. + + Accept a stream of data as well, but will be load at once in memory for now. + + If no content-type, will return the string version (not bytes, not stream) + + :param data: Input, could be bytes or stream (will be decoded with UTF8) or text + :type data: str or bytes or IO + :param str content_type: The content type. + :return: The deserialized data. + :rtype: object + """ + if hasattr(data, "read"): + # Assume a stream + data = cast(IO, data).read() + + if isinstance(data, bytes): + data_as_str = data.decode(encoding="utf-8-sig") + else: + # Explain to mypy the correct type. + data_as_str = cast(str, data) + + # Remove Byte Order Mark if present in string + data_as_str = data_as_str.lstrip(_BOM) + + if content_type is None: + return data + + if cls.JSON_REGEXP.match(content_type): + try: + return json.loads(data_as_str) + except ValueError as err: + raise DeserializationError("JSON is invalid: {}".format(err), err) from err + elif "xml" in (content_type or []): + try: + + try: + if isinstance(data, unicode): # type: ignore + # If I'm Python 2.7 and unicode XML will scream if I try a "fromstring" on unicode string + data_as_str = data_as_str.encode(encoding="utf-8") # type: ignore + except NameError: + pass + + return ET.fromstring(data_as_str) # nosec + except ET.ParseError as err: + # It might be because the server has an issue, and returned JSON with + # content-type XML.... + # So let's try a JSON load, and if it's still broken + # let's flow the initial exception + def _json_attemp(data): + try: + return True, json.loads(data) + except ValueError: + return False, None # Don't care about this one + + success, json_result = _json_attemp(data) + if success: + return json_result + # If i'm here, it's not JSON, it's not XML, let's scream + # and raise the last context in this block (the XML exception) + # The function hack is because Py2.7 messes up with exception + # context otherwise. + _LOGGER.critical("Wasn't XML not JSON, failing") + raise DeserializationError("XML is invalid") from err + elif content_type.startswith("text/"): + return data_as_str + raise DeserializationError("Cannot deserialize content-type: {}".format(content_type)) + + @classmethod + def deserialize_from_http_generics(cls, body_bytes: Optional[Union[AnyStr, IO]], headers: Mapping) -> Any: + """Deserialize from HTTP response. + + Use bytes and headers to NOT use any requests/aiohttp or whatever + specific implementation. + Headers will tested for "content-type" + + :param bytes body_bytes: The body of the response. + :param dict headers: The headers of the response. + :returns: The deserialized data. + :rtype: object + """ + # Try to use content-type from headers if available + content_type = None + if "content-type" in headers: + content_type = headers["content-type"].split(";")[0].strip().lower() + # Ouch, this server did not declare what it sent... + # Let's guess it's JSON... + # Also, since Autorest was considering that an empty body was a valid JSON, + # need that test as well.... + else: + content_type = "application/json" + + if body_bytes: + return cls.deserialize_from_text(body_bytes, content_type) + return None + + +_LOGGER = logging.getLogger(__name__) + +try: + _long_type = long # type: ignore +except NameError: + _long_type = int + + +class UTC(datetime.tzinfo): + """Time Zone info for handling UTC""" + + def utcoffset(self, dt): + """UTF offset for UTC is 0. + + :param datetime.datetime dt: The datetime + :returns: The offset + :rtype: datetime.timedelta + """ + return datetime.timedelta(0) + + def tzname(self, dt): + """Timestamp representation. + + :param datetime.datetime dt: The datetime + :returns: The timestamp representation + :rtype: str + """ + return "Z" + + def dst(self, dt): + """No daylight saving for UTC. + + :param datetime.datetime dt: The datetime + :returns: The daylight saving time + :rtype: datetime.timedelta + """ + return datetime.timedelta(hours=1) + + +try: + from datetime import timezone as _FixedOffset # type: ignore +except ImportError: # Python 2.7 + + class _FixedOffset(datetime.tzinfo): # type: ignore + """Fixed offset in minutes east from UTC. + Copy/pasted from Python doc + :param datetime.timedelta offset: offset in timedelta format + """ + + def __init__(self, offset): + self.__offset = offset + + def utcoffset(self, dt): + return self.__offset + + def tzname(self, dt): + return str(self.__offset.total_seconds() / 3600) + + def __repr__(self): + return "".format(self.tzname(None)) + + def dst(self, dt): + return datetime.timedelta(0) + + def __getinitargs__(self): + return (self.__offset,) + + +try: + from datetime import timezone + + TZ_UTC = timezone.utc +except ImportError: + TZ_UTC = UTC() # type: ignore + +_FLATTEN = re.compile(r"(? None: + self.additional_properties: Optional[Dict[str, Any]] = {} + for k in kwargs: # pylint: disable=consider-using-dict-items + if k not in self._attribute_map: + _LOGGER.warning("%s is not a known attribute of class %s and will be ignored", k, self.__class__) + elif k in self._validation and self._validation[k].get("readonly", False): + _LOGGER.warning("Readonly attribute %s will be ignored in class %s", k, self.__class__) + else: + setattr(self, k, kwargs[k]) + + def __eq__(self, other: Any) -> bool: + """Compare objects by comparing all attributes. + + :param object other: The object to compare + :returns: True if objects are equal + :rtype: bool + """ + if isinstance(other, self.__class__): + return self.__dict__ == other.__dict__ + return False + + def __ne__(self, other: Any) -> bool: + """Compare objects by comparing all attributes. + + :param object other: The object to compare + :returns: True if objects are not equal + :rtype: bool + """ + return not self.__eq__(other) + + def __str__(self) -> str: + return str(self.__dict__) + + @classmethod + def enable_additional_properties_sending(cls) -> None: + cls._attribute_map["additional_properties"] = {"key": "", "type": "{object}"} + + @classmethod + def is_xml_model(cls) -> bool: + try: + cls._xml_map # type: ignore + except AttributeError: + return False + return True + + @classmethod + def _create_xml_node(cls): + """Create XML node. + + :returns: The XML node + :rtype: xml.etree.ElementTree.Element + """ + try: + xml_map = cls._xml_map # type: ignore + except AttributeError: + xml_map = {} + + return _create_xml_node(xml_map.get("name", cls.__name__), xml_map.get("prefix", None), xml_map.get("ns", None)) + + def serialize(self, keep_readonly: bool = False, **kwargs: Any) -> JSON: + """Return the JSON that would be sent to server from this model. + + This is an alias to `as_dict(full_restapi_key_transformer, keep_readonly=False)`. + + If you want XML serialization, you can pass the kwargs is_xml=True. + + :param bool keep_readonly: If you want to serialize the readonly attributes + :returns: A dict JSON compatible object + :rtype: dict + """ + serializer = Serializer(self._infer_class_models()) + return serializer._serialize( # type: ignore # pylint: disable=protected-access + self, keep_readonly=keep_readonly, **kwargs + ) + + def as_dict( + self, + keep_readonly: bool = True, + key_transformer: Callable[[str, Dict[str, Any], Any], Any] = attribute_transformer, + **kwargs: Any + ) -> JSON: + """Return a dict that can be serialized using json.dump. + + Advanced usage might optionally use a callback as parameter: + + .. code::python + + def my_key_transformer(key, attr_desc, value): + return key + + Key is the attribute name used in Python. Attr_desc + is a dict of metadata. Currently contains 'type' with the + msrest type and 'key' with the RestAPI encoded key. + Value is the current value in this object. + + The string returned will be used to serialize the key. + If the return type is a list, this is considered hierarchical + result dict. + + See the three examples in this file: + + - attribute_transformer + - full_restapi_key_transformer + - last_restapi_key_transformer + + If you want XML serialization, you can pass the kwargs is_xml=True. + + :param bool keep_readonly: If you want to serialize the readonly attributes + :param function key_transformer: A key transformer function. + :returns: A dict JSON compatible object + :rtype: dict + """ + serializer = Serializer(self._infer_class_models()) + return serializer._serialize( # type: ignore # pylint: disable=protected-access + self, key_transformer=key_transformer, keep_readonly=keep_readonly, **kwargs + ) + + @classmethod + def _infer_class_models(cls): + try: + str_models = cls.__module__.rsplit(".", 1)[0] + models = sys.modules[str_models] + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + if cls.__name__ not in client_models: + raise ValueError("Not Autorest generated code") + except Exception: # pylint: disable=broad-exception-caught + # Assume it's not Autorest generated (tests?). Add ourselves as dependencies. + client_models = {cls.__name__: cls} + return client_models + + @classmethod + def deserialize(cls: Type[ModelType], data: Any, content_type: Optional[str] = None) -> ModelType: + """Parse a str using the RestAPI syntax and return a model. + + :param str data: A str using RestAPI structure. JSON by default. + :param str content_type: JSON by default, set application/xml if XML. + :returns: An instance of this model + :raises: DeserializationError if something went wrong + :rtype: ModelType + """ + deserializer = Deserializer(cls._infer_class_models()) + return deserializer(cls.__name__, data, content_type=content_type) # type: ignore + + @classmethod + def from_dict( + cls: Type[ModelType], + data: Any, + key_extractors: Optional[Callable[[str, Dict[str, Any], Any], Any]] = None, + content_type: Optional[str] = None, + ) -> ModelType: + """Parse a dict using given key extractor return a model. + + By default consider key + extractors (rest_key_case_insensitive_extractor, attribute_key_case_insensitive_extractor + and last_rest_key_case_insensitive_extractor) + + :param dict data: A dict using RestAPI structure + :param function key_extractors: A key extractor function. + :param str content_type: JSON by default, set application/xml if XML. + :returns: An instance of this model + :raises: DeserializationError if something went wrong + :rtype: ModelType + """ + deserializer = Deserializer(cls._infer_class_models()) + deserializer.key_extractors = ( # type: ignore + [ # type: ignore + attribute_key_case_insensitive_extractor, + rest_key_case_insensitive_extractor, + last_rest_key_case_insensitive_extractor, + ] + if key_extractors is None + else key_extractors + ) + return deserializer(cls.__name__, data, content_type=content_type) # type: ignore + + @classmethod + def _flatten_subtype(cls, key, objects): + if "_subtype_map" not in cls.__dict__: + return {} + result = dict(cls._subtype_map[key]) + for valuetype in cls._subtype_map[key].values(): + result.update(objects[valuetype]._flatten_subtype(key, objects)) # pylint: disable=protected-access + return result + + @classmethod + def _classify(cls, response, objects): + """Check the class _subtype_map for any child classes. + We want to ignore any inherited _subtype_maps. + Remove the polymorphic key from the initial data. + + :param dict response: The initial data + :param dict objects: The class objects + :returns: The class to be used + :rtype: class + """ + for subtype_key in cls.__dict__.get("_subtype_map", {}).keys(): + subtype_value = None + + if not isinstance(response, ET.Element): + rest_api_response_key = cls._get_rest_key_parts(subtype_key)[-1] + subtype_value = response.pop(rest_api_response_key, None) or response.pop(subtype_key, None) + else: + subtype_value = xml_key_extractor(subtype_key, cls._attribute_map[subtype_key], response) + if subtype_value: + # Try to match base class. Can be class name only + # (bug to fix in Autorest to support x-ms-discriminator-name) + if cls.__name__ == subtype_value: + return cls + flatten_mapping_type = cls._flatten_subtype(subtype_key, objects) + try: + return objects[flatten_mapping_type[subtype_value]] # type: ignore + except KeyError: + _LOGGER.warning( + "Subtype value %s has no mapping, use base class %s.", + subtype_value, + cls.__name__, + ) + break + else: + _LOGGER.warning("Discriminator %s is absent or null, use base class %s.", subtype_key, cls.__name__) + break + return cls + + @classmethod + def _get_rest_key_parts(cls, attr_key): + """Get the RestAPI key of this attr, split it and decode part + :param str attr_key: Attribute key must be in attribute_map. + :returns: A list of RestAPI part + :rtype: list + """ + rest_split_key = _FLATTEN.split(cls._attribute_map[attr_key]["key"]) + return [_decode_attribute_map_key(key_part) for key_part in rest_split_key] + + +def _decode_attribute_map_key(key): + """This decode a key in an _attribute_map to the actual key we want to look at + inside the received data. + + :param str key: A key string from the generated code + :returns: The decoded key + :rtype: str + """ + return key.replace("\\.", ".") + + +class Serializer(object): # pylint: disable=too-many-public-methods + """Request object model serializer.""" + + basic_types = {str: "str", int: "int", bool: "bool", float: "float"} + + _xml_basic_types_serializers = {"bool": lambda x: str(x).lower()} + days = {0: "Mon", 1: "Tue", 2: "Wed", 3: "Thu", 4: "Fri", 5: "Sat", 6: "Sun"} + months = { + 1: "Jan", + 2: "Feb", + 3: "Mar", + 4: "Apr", + 5: "May", + 6: "Jun", + 7: "Jul", + 8: "Aug", + 9: "Sep", + 10: "Oct", + 11: "Nov", + 12: "Dec", + } + validation = { + "min_length": lambda x, y: len(x) < y, + "max_length": lambda x, y: len(x) > y, + "minimum": lambda x, y: x < y, + "maximum": lambda x, y: x > y, + "minimum_ex": lambda x, y: x <= y, + "maximum_ex": lambda x, y: x >= y, + "min_items": lambda x, y: len(x) < y, + "max_items": lambda x, y: len(x) > y, + "pattern": lambda x, y: not re.match(y, x, re.UNICODE), + "unique": lambda x, y: len(x) != len(set(x)), + "multiple": lambda x, y: x % y != 0, + } + + def __init__(self, classes: Optional[Mapping[str, type]] = None): + self.serialize_type = { + "iso-8601": Serializer.serialize_iso, + "rfc-1123": Serializer.serialize_rfc, + "unix-time": Serializer.serialize_unix, + "duration": Serializer.serialize_duration, + "date": Serializer.serialize_date, + "time": Serializer.serialize_time, + "decimal": Serializer.serialize_decimal, + "long": Serializer.serialize_long, + "bytearray": Serializer.serialize_bytearray, + "base64": Serializer.serialize_base64, + "object": self.serialize_object, + "[]": self.serialize_iter, + "{}": self.serialize_dict, + } + self.dependencies: Dict[str, type] = dict(classes) if classes else {} + self.key_transformer = full_restapi_key_transformer + self.client_side_validation = True + + def _serialize( # pylint: disable=too-many-nested-blocks, too-many-branches, too-many-statements, too-many-locals + self, target_obj, data_type=None, **kwargs + ): + """Serialize data into a string according to type. + + :param object target_obj: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str, dict + :raises: SerializationError if serialization fails. + :returns: The serialized data. + """ + key_transformer = kwargs.get("key_transformer", self.key_transformer) + keep_readonly = kwargs.get("keep_readonly", False) + if target_obj is None: + return None + + attr_name = None + class_name = target_obj.__class__.__name__ + + if data_type: + return self.serialize_data(target_obj, data_type, **kwargs) + + if not hasattr(target_obj, "_attribute_map"): + data_type = type(target_obj).__name__ + if data_type in self.basic_types.values(): + return self.serialize_data(target_obj, data_type, **kwargs) + + # Force "is_xml" kwargs if we detect a XML model + try: + is_xml_model_serialization = kwargs["is_xml"] + except KeyError: + is_xml_model_serialization = kwargs.setdefault("is_xml", target_obj.is_xml_model()) + + serialized = {} + if is_xml_model_serialization: + serialized = target_obj._create_xml_node() # pylint: disable=protected-access + try: + attributes = target_obj._attribute_map # pylint: disable=protected-access + for attr, attr_desc in attributes.items(): + attr_name = attr + if not keep_readonly and target_obj._validation.get( # pylint: disable=protected-access + attr_name, {} + ).get("readonly", False): + continue + + if attr_name == "additional_properties" and attr_desc["key"] == "": + if target_obj.additional_properties is not None: + serialized.update(target_obj.additional_properties) + continue + try: + + orig_attr = getattr(target_obj, attr) + if is_xml_model_serialization: + pass # Don't provide "transformer" for XML for now. Keep "orig_attr" + else: # JSON + keys, orig_attr = key_transformer(attr, attr_desc.copy(), orig_attr) + keys = keys if isinstance(keys, list) else [keys] + + kwargs["serialization_ctxt"] = attr_desc + new_attr = self.serialize_data(orig_attr, attr_desc["type"], **kwargs) + + if is_xml_model_serialization: + xml_desc = attr_desc.get("xml", {}) + xml_name = xml_desc.get("name", attr_desc["key"]) + xml_prefix = xml_desc.get("prefix", None) + xml_ns = xml_desc.get("ns", None) + if xml_desc.get("attr", False): + if xml_ns: + ET.register_namespace(xml_prefix, xml_ns) + xml_name = "{{{}}}{}".format(xml_ns, xml_name) + serialized.set(xml_name, new_attr) # type: ignore + continue + if xml_desc.get("text", False): + serialized.text = new_attr # type: ignore + continue + if isinstance(new_attr, list): + serialized.extend(new_attr) # type: ignore + elif isinstance(new_attr, ET.Element): + # If the down XML has no XML/Name, + # we MUST replace the tag with the local tag. But keeping the namespaces. + if "name" not in getattr(orig_attr, "_xml_map", {}): + splitted_tag = new_attr.tag.split("}") + if len(splitted_tag) == 2: # Namespace + new_attr.tag = "}".join([splitted_tag[0], xml_name]) + else: + new_attr.tag = xml_name + serialized.append(new_attr) # type: ignore + else: # That's a basic type + # Integrate namespace if necessary + local_node = _create_xml_node(xml_name, xml_prefix, xml_ns) + local_node.text = str(new_attr) + serialized.append(local_node) # type: ignore + else: # JSON + for k in reversed(keys): # type: ignore + new_attr = {k: new_attr} + + _new_attr = new_attr + _serialized = serialized + for k in keys: # type: ignore + if k not in _serialized: + _serialized.update(_new_attr) # type: ignore + _new_attr = _new_attr[k] # type: ignore + _serialized = _serialized[k] + except ValueError as err: + if isinstance(err, SerializationError): + raise + + except (AttributeError, KeyError, TypeError) as err: + msg = "Attribute {} in object {} cannot be serialized.\n{}".format(attr_name, class_name, str(target_obj)) + raise SerializationError(msg) from err + return serialized + + def body(self, data, data_type, **kwargs): + """Serialize data intended for a request body. + + :param object data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: dict + :raises: SerializationError if serialization fails. + :raises: ValueError if data is None + :returns: The serialized request body + """ + + # Just in case this is a dict + internal_data_type_str = data_type.strip("[]{}") + internal_data_type = self.dependencies.get(internal_data_type_str, None) + try: + is_xml_model_serialization = kwargs["is_xml"] + except KeyError: + if internal_data_type and issubclass(internal_data_type, Model): + is_xml_model_serialization = kwargs.setdefault("is_xml", internal_data_type.is_xml_model()) + else: + is_xml_model_serialization = False + if internal_data_type and not isinstance(internal_data_type, Enum): + try: + deserializer = Deserializer(self.dependencies) + # Since it's on serialization, it's almost sure that format is not JSON REST + # We're not able to deal with additional properties for now. + deserializer.additional_properties_detection = False + if is_xml_model_serialization: + deserializer.key_extractors = [ # type: ignore + attribute_key_case_insensitive_extractor, + ] + else: + deserializer.key_extractors = [ + rest_key_case_insensitive_extractor, + attribute_key_case_insensitive_extractor, + last_rest_key_case_insensitive_extractor, + ] + data = deserializer._deserialize(data_type, data) # pylint: disable=protected-access + except DeserializationError as err: + raise SerializationError("Unable to build a model: " + str(err)) from err + + return self._serialize(data, data_type, **kwargs) + + def url(self, name, data, data_type, **kwargs): + """Serialize data intended for a URL path. + + :param str name: The name of the URL path parameter. + :param object data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str + :returns: The serialized URL path + :raises: TypeError if serialization fails. + :raises: ValueError if data is None + """ + try: + output = self.serialize_data(data, data_type, **kwargs) + if data_type == "bool": + output = json.dumps(output) + + if kwargs.get("skip_quote") is True: + output = str(output) + output = output.replace("{", quote("{")).replace("}", quote("}")) + else: + output = quote(str(output), safe="") + except SerializationError as exc: + raise TypeError("{} must be type {}.".format(name, data_type)) from exc + return output + + def query(self, name, data, data_type, **kwargs): + """Serialize data intended for a URL query. + + :param str name: The name of the query parameter. + :param object data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str, list + :raises: TypeError if serialization fails. + :raises: ValueError if data is None + :returns: The serialized query parameter + """ + try: + # Treat the list aside, since we don't want to encode the div separator + if data_type.startswith("["): + internal_data_type = data_type[1:-1] + do_quote = not kwargs.get("skip_quote", False) + return self.serialize_iter(data, internal_data_type, do_quote=do_quote, **kwargs) + + # Not a list, regular serialization + output = self.serialize_data(data, data_type, **kwargs) + if data_type == "bool": + output = json.dumps(output) + if kwargs.get("skip_quote") is True: + output = str(output) + else: + output = quote(str(output), safe="") + except SerializationError as exc: + raise TypeError("{} must be type {}.".format(name, data_type)) from exc + return str(output) + + def header(self, name, data, data_type, **kwargs): + """Serialize data intended for a request header. + + :param str name: The name of the header. + :param object data: The data to be serialized. + :param str data_type: The type to be serialized from. + :rtype: str + :raises: TypeError if serialization fails. + :raises: ValueError if data is None + :returns: The serialized header + """ + try: + if data_type in ["[str]"]: + data = ["" if d is None else d for d in data] + + output = self.serialize_data(data, data_type, **kwargs) + if data_type == "bool": + output = json.dumps(output) + except SerializationError as exc: + raise TypeError("{} must be type {}.".format(name, data_type)) from exc + return str(output) + + def serialize_data(self, data, data_type, **kwargs): + """Serialize generic data according to supplied data type. + + :param object data: The data to be serialized. + :param str data_type: The type to be serialized from. + :raises: AttributeError if required data is None. + :raises: ValueError if data is None + :raises: SerializationError if serialization fails. + :returns: The serialized data. + :rtype: str, int, float, bool, dict, list + """ + if data is None: + raise ValueError("No value for given attribute") + + try: + if data is CoreNull: + return None + if data_type in self.basic_types.values(): + return self.serialize_basic(data, data_type, **kwargs) + + if data_type in self.serialize_type: + return self.serialize_type[data_type](data, **kwargs) + + # If dependencies is empty, try with current data class + # It has to be a subclass of Enum anyway + enum_type = self.dependencies.get(data_type, data.__class__) + if issubclass(enum_type, Enum): + return Serializer.serialize_enum(data, enum_obj=enum_type) + + iter_type = data_type[0] + data_type[-1] + if iter_type in self.serialize_type: + return self.serialize_type[iter_type](data, data_type[1:-1], **kwargs) + + except (ValueError, TypeError) as err: + msg = "Unable to serialize value: {!r} as type: {!r}." + raise SerializationError(msg.format(data, data_type)) from err + return self._serialize(data, **kwargs) + + @classmethod + def _get_custom_serializers(cls, data_type, **kwargs): # pylint: disable=inconsistent-return-statements + custom_serializer = kwargs.get("basic_types_serializers", {}).get(data_type) + if custom_serializer: + return custom_serializer + if kwargs.get("is_xml", False): + return cls._xml_basic_types_serializers.get(data_type) + + @classmethod + def serialize_basic(cls, data, data_type, **kwargs): + """Serialize basic builting data type. + Serializes objects to str, int, float or bool. + + Possible kwargs: + - basic_types_serializers dict[str, callable] : If set, use the callable as serializer + - is_xml bool : If set, use xml_basic_types_serializers + + :param obj data: Object to be serialized. + :param str data_type: Type of object in the iterable. + :rtype: str, int, float, bool + :return: serialized object + """ + custom_serializer = cls._get_custom_serializers(data_type, **kwargs) + if custom_serializer: + return custom_serializer(data) + if data_type == "str": + return cls.serialize_unicode(data) + return eval(data_type)(data) # nosec # pylint: disable=eval-used + + @classmethod + def serialize_unicode(cls, data): + """Special handling for serializing unicode strings in Py2. + Encode to UTF-8 if unicode, otherwise handle as a str. + + :param str data: Object to be serialized. + :rtype: str + :return: serialized object + """ + try: # If I received an enum, return its value + return data.value + except AttributeError: + pass + + try: + if isinstance(data, unicode): # type: ignore + # Don't change it, JSON and XML ElementTree are totally able + # to serialize correctly u'' strings + return data + except NameError: + return str(data) + return str(data) + + def serialize_iter(self, data, iter_type, div=None, **kwargs): + """Serialize iterable. + + Supported kwargs: + - serialization_ctxt dict : The current entry of _attribute_map, or same format. + serialization_ctxt['type'] should be same as data_type. + - is_xml bool : If set, serialize as XML + + :param list data: Object to be serialized. + :param str iter_type: Type of object in the iterable. + :param str div: If set, this str will be used to combine the elements + in the iterable into a combined string. Default is 'None'. + Defaults to False. + :rtype: list, str + :return: serialized iterable + """ + if isinstance(data, str): + raise SerializationError("Refuse str type as a valid iter type.") + + serialization_ctxt = kwargs.get("serialization_ctxt", {}) + is_xml = kwargs.get("is_xml", False) + + serialized = [] + for d in data: + try: + serialized.append(self.serialize_data(d, iter_type, **kwargs)) + except ValueError as err: + if isinstance(err, SerializationError): + raise + serialized.append(None) + + if kwargs.get("do_quote", False): + serialized = ["" if s is None else quote(str(s), safe="") for s in serialized] + + if div: + serialized = ["" if s is None else str(s) for s in serialized] + serialized = div.join(serialized) + + if "xml" in serialization_ctxt or is_xml: + # XML serialization is more complicated + xml_desc = serialization_ctxt.get("xml", {}) + xml_name = xml_desc.get("name") + if not xml_name: + xml_name = serialization_ctxt["key"] + + # Create a wrap node if necessary (use the fact that Element and list have "append") + is_wrapped = xml_desc.get("wrapped", False) + node_name = xml_desc.get("itemsName", xml_name) + if is_wrapped: + final_result = _create_xml_node(xml_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) + else: + final_result = [] + # All list elements to "local_node" + for el in serialized: + if isinstance(el, ET.Element): + el_node = el + else: + el_node = _create_xml_node(node_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) + if el is not None: # Otherwise it writes "None" :-p + el_node.text = str(el) + final_result.append(el_node) + return final_result + return serialized + + def serialize_dict(self, attr, dict_type, **kwargs): + """Serialize a dictionary of objects. + + :param dict attr: Object to be serialized. + :param str dict_type: Type of object in the dictionary. + :rtype: dict + :return: serialized dictionary + """ + serialization_ctxt = kwargs.get("serialization_ctxt", {}) + serialized = {} + for key, value in attr.items(): + try: + serialized[self.serialize_unicode(key)] = self.serialize_data(value, dict_type, **kwargs) + except ValueError as err: + if isinstance(err, SerializationError): + raise + serialized[self.serialize_unicode(key)] = None + + if "xml" in serialization_ctxt: + # XML serialization is more complicated + xml_desc = serialization_ctxt["xml"] + xml_name = xml_desc["name"] + + final_result = _create_xml_node(xml_name, xml_desc.get("prefix", None), xml_desc.get("ns", None)) + for key, value in serialized.items(): + ET.SubElement(final_result, key).text = value + return final_result + + return serialized + + def serialize_object(self, attr, **kwargs): # pylint: disable=too-many-return-statements + """Serialize a generic object. + This will be handled as a dictionary. If object passed in is not + a basic type (str, int, float, dict, list) it will simply be + cast to str. + + :param dict attr: Object to be serialized. + :rtype: dict or str + :return: serialized object + """ + if attr is None: + return None + if isinstance(attr, ET.Element): + return attr + obj_type = type(attr) + if obj_type in self.basic_types: + return self.serialize_basic(attr, self.basic_types[obj_type], **kwargs) + if obj_type is _long_type: + return self.serialize_long(attr) + if obj_type is str: + return self.serialize_unicode(attr) + if obj_type is datetime.datetime: + return self.serialize_iso(attr) + if obj_type is datetime.date: + return self.serialize_date(attr) + if obj_type is datetime.time: + return self.serialize_time(attr) + if obj_type is datetime.timedelta: + return self.serialize_duration(attr) + if obj_type is decimal.Decimal: + return self.serialize_decimal(attr) + + # If it's a model or I know this dependency, serialize as a Model + if obj_type in self.dependencies.values() or isinstance(attr, Model): + return self._serialize(attr) + + if obj_type == dict: + serialized = {} + for key, value in attr.items(): + try: + serialized[self.serialize_unicode(key)] = self.serialize_object(value, **kwargs) + except ValueError: + serialized[self.serialize_unicode(key)] = None + return serialized + + if obj_type == list: + serialized = [] + for obj in attr: + try: + serialized.append(self.serialize_object(obj, **kwargs)) + except ValueError: + pass + return serialized + return str(attr) + + @staticmethod + def serialize_enum(attr, enum_obj=None): + try: + result = attr.value + except AttributeError: + result = attr + try: + enum_obj(result) # type: ignore + return result + except ValueError as exc: + for enum_value in enum_obj: # type: ignore + if enum_value.value.lower() == str(attr).lower(): + return enum_value.value + error = "{!r} is not valid value for enum {!r}" + raise SerializationError(error.format(attr, enum_obj)) from exc + + @staticmethod + def serialize_bytearray(attr, **kwargs): # pylint: disable=unused-argument + """Serialize bytearray into base-64 string. + + :param str attr: Object to be serialized. + :rtype: str + :return: serialized base64 + """ + return b64encode(attr).decode() + + @staticmethod + def serialize_base64(attr, **kwargs): # pylint: disable=unused-argument + """Serialize str into base-64 string. + + :param str attr: Object to be serialized. + :rtype: str + :return: serialized base64 + """ + encoded = b64encode(attr).decode("ascii") + return encoded.strip("=").replace("+", "-").replace("/", "_") + + @staticmethod + def serialize_decimal(attr, **kwargs): # pylint: disable=unused-argument + """Serialize Decimal object to float. + + :param decimal attr: Object to be serialized. + :rtype: float + :return: serialized decimal + """ + return float(attr) + + @staticmethod + def serialize_long(attr, **kwargs): # pylint: disable=unused-argument + """Serialize long (Py2) or int (Py3). + + :param int attr: Object to be serialized. + :rtype: int/long + :return: serialized long + """ + return _long_type(attr) + + @staticmethod + def serialize_date(attr, **kwargs): # pylint: disable=unused-argument + """Serialize Date object into ISO-8601 formatted string. + + :param Date attr: Object to be serialized. + :rtype: str + :return: serialized date + """ + if isinstance(attr, str): + attr = isodate.parse_date(attr) + t = "{:04}-{:02}-{:02}".format(attr.year, attr.month, attr.day) + return t + + @staticmethod + def serialize_time(attr, **kwargs): # pylint: disable=unused-argument + """Serialize Time object into ISO-8601 formatted string. + + :param datetime.time attr: Object to be serialized. + :rtype: str + :return: serialized time + """ + if isinstance(attr, str): + attr = isodate.parse_time(attr) + t = "{:02}:{:02}:{:02}".format(attr.hour, attr.minute, attr.second) + if attr.microsecond: + t += ".{:02}".format(attr.microsecond) + return t + + @staticmethod + def serialize_duration(attr, **kwargs): # pylint: disable=unused-argument + """Serialize TimeDelta object into ISO-8601 formatted string. + + :param TimeDelta attr: Object to be serialized. + :rtype: str + :return: serialized duration + """ + if isinstance(attr, str): + attr = isodate.parse_duration(attr) + return isodate.duration_isoformat(attr) + + @staticmethod + def serialize_rfc(attr, **kwargs): # pylint: disable=unused-argument + """Serialize Datetime object into RFC-1123 formatted string. + + :param Datetime attr: Object to be serialized. + :rtype: str + :raises: TypeError if format invalid. + :return: serialized rfc + """ + try: + if not attr.tzinfo: + _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") + utc = attr.utctimetuple() + except AttributeError as exc: + raise TypeError("RFC1123 object must be valid Datetime object.") from exc + + return "{}, {:02} {} {:04} {:02}:{:02}:{:02} GMT".format( + Serializer.days[utc.tm_wday], + utc.tm_mday, + Serializer.months[utc.tm_mon], + utc.tm_year, + utc.tm_hour, + utc.tm_min, + utc.tm_sec, + ) + + @staticmethod + def serialize_iso(attr, **kwargs): # pylint: disable=unused-argument + """Serialize Datetime object into ISO-8601 formatted string. + + :param Datetime attr: Object to be serialized. + :rtype: str + :raises: SerializationError if format invalid. + :return: serialized iso + """ + if isinstance(attr, str): + attr = isodate.parse_datetime(attr) + try: + if not attr.tzinfo: + _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") + utc = attr.utctimetuple() + if utc.tm_year > 9999 or utc.tm_year < 1: + raise OverflowError("Hit max or min date") + + microseconds = str(attr.microsecond).rjust(6, "0").rstrip("0").ljust(3, "0") + if microseconds: + microseconds = "." + microseconds + date = "{:04}-{:02}-{:02}T{:02}:{:02}:{:02}".format( + utc.tm_year, utc.tm_mon, utc.tm_mday, utc.tm_hour, utc.tm_min, utc.tm_sec + ) + return date + microseconds + "Z" + except (ValueError, OverflowError) as err: + msg = "Unable to serialize datetime object." + raise SerializationError(msg) from err + except AttributeError as err: + msg = "ISO-8601 object must be valid Datetime object." + raise TypeError(msg) from err + + @staticmethod + def serialize_unix(attr, **kwargs): # pylint: disable=unused-argument + """Serialize Datetime object into IntTime format. + This is represented as seconds. + + :param Datetime attr: Object to be serialized. + :rtype: int + :raises: SerializationError if format invalid + :return: serialied unix + """ + if isinstance(attr, int): + return attr + try: + if not attr.tzinfo: + _LOGGER.warning("Datetime with no tzinfo will be considered UTC.") + return int(calendar.timegm(attr.utctimetuple())) + except AttributeError as exc: + raise TypeError("Unix time object must be valid Datetime object.") from exc + + +def rest_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument + key = attr_desc["key"] + working_data = data + + while "." in key: + # Need the cast, as for some reasons "split" is typed as list[str | Any] + dict_keys = cast(List[str], _FLATTEN.split(key)) + if len(dict_keys) == 1: + key = _decode_attribute_map_key(dict_keys[0]) + break + working_key = _decode_attribute_map_key(dict_keys[0]) + working_data = working_data.get(working_key, data) + if working_data is None: + # If at any point while following flatten JSON path see None, it means + # that all properties under are None as well + return None + key = ".".join(dict_keys[1:]) + + return working_data.get(key) + + +def rest_key_case_insensitive_extractor( # pylint: disable=unused-argument, inconsistent-return-statements + attr, attr_desc, data +): + key = attr_desc["key"] + working_data = data + + while "." in key: + dict_keys = _FLATTEN.split(key) + if len(dict_keys) == 1: + key = _decode_attribute_map_key(dict_keys[0]) + break + working_key = _decode_attribute_map_key(dict_keys[0]) + working_data = attribute_key_case_insensitive_extractor(working_key, None, working_data) + if working_data is None: + # If at any point while following flatten JSON path see None, it means + # that all properties under are None as well + return None + key = ".".join(dict_keys[1:]) + + if working_data: + return attribute_key_case_insensitive_extractor(key, None, working_data) + + +def last_rest_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument + """Extract the attribute in "data" based on the last part of the JSON path key. + + :param str attr: The attribute to extract + :param dict attr_desc: The attribute description + :param dict data: The data to extract from + :rtype: object + :returns: The extracted attribute + """ + key = attr_desc["key"] + dict_keys = _FLATTEN.split(key) + return attribute_key_extractor(dict_keys[-1], None, data) + + +def last_rest_key_case_insensitive_extractor(attr, attr_desc, data): # pylint: disable=unused-argument + """Extract the attribute in "data" based on the last part of the JSON path key. + + This is the case insensitive version of "last_rest_key_extractor" + :param str attr: The attribute to extract + :param dict attr_desc: The attribute description + :param dict data: The data to extract from + :rtype: object + :returns: The extracted attribute + """ + key = attr_desc["key"] + dict_keys = _FLATTEN.split(key) + return attribute_key_case_insensitive_extractor(dict_keys[-1], None, data) + + +def attribute_key_extractor(attr, _, data): + return data.get(attr) + + +def attribute_key_case_insensitive_extractor(attr, _, data): + found_key = None + lower_attr = attr.lower() + for key in data: + if lower_attr == key.lower(): + found_key = key + break + + return data.get(found_key) + + +def _extract_name_from_internal_type(internal_type): + """Given an internal type XML description, extract correct XML name with namespace. + + :param dict internal_type: An model type + :rtype: tuple + :returns: A tuple XML name + namespace dict + """ + internal_type_xml_map = getattr(internal_type, "_xml_map", {}) + xml_name = internal_type_xml_map.get("name", internal_type.__name__) + xml_ns = internal_type_xml_map.get("ns", None) + if xml_ns: + xml_name = "{{{}}}{}".format(xml_ns, xml_name) + return xml_name + + +def xml_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument,too-many-return-statements + if isinstance(data, dict): + return None + + # Test if this model is XML ready first + if not isinstance(data, ET.Element): + return None + + xml_desc = attr_desc.get("xml", {}) + xml_name = xml_desc.get("name", attr_desc["key"]) + + # Look for a children + is_iter_type = attr_desc["type"].startswith("[") + is_wrapped = xml_desc.get("wrapped", False) + internal_type = attr_desc.get("internalType", None) + internal_type_xml_map = getattr(internal_type, "_xml_map", {}) + + # Integrate namespace if necessary + xml_ns = xml_desc.get("ns", internal_type_xml_map.get("ns", None)) + if xml_ns: + xml_name = "{{{}}}{}".format(xml_ns, xml_name) + + # If it's an attribute, that's simple + if xml_desc.get("attr", False): + return data.get(xml_name) + + # If it's x-ms-text, that's simple too + if xml_desc.get("text", False): + return data.text + + # Scenario where I take the local name: + # - Wrapped node + # - Internal type is an enum (considered basic types) + # - Internal type has no XML/Name node + if is_wrapped or (internal_type and (issubclass(internal_type, Enum) or "name" not in internal_type_xml_map)): + children = data.findall(xml_name) + # If internal type has a local name and it's not a list, I use that name + elif not is_iter_type and internal_type and "name" in internal_type_xml_map: + xml_name = _extract_name_from_internal_type(internal_type) + children = data.findall(xml_name) + # That's an array + else: + if internal_type: # Complex type, ignore itemsName and use the complex type name + items_name = _extract_name_from_internal_type(internal_type) + else: + items_name = xml_desc.get("itemsName", xml_name) + children = data.findall(items_name) + + if len(children) == 0: + if is_iter_type: + if is_wrapped: + return None # is_wrapped no node, we want None + return [] # not wrapped, assume empty list + return None # Assume it's not there, maybe an optional node. + + # If is_iter_type and not wrapped, return all found children + if is_iter_type: + if not is_wrapped: + return children + # Iter and wrapped, should have found one node only (the wrap one) + if len(children) != 1: + raise DeserializationError( + "Tried to deserialize an array not wrapped, and found several nodes '{}'. Maybe you should declare this array as wrapped?".format( # pylint: disable=line-too-long + xml_name + ) + ) + return list(children[0]) # Might be empty list and that's ok. + + # Here it's not a itertype, we should have found one element only or empty + if len(children) > 1: + raise DeserializationError("Find several XML '{}' where it was not expected".format(xml_name)) + return children[0] + + +class Deserializer(object): + """Response object model deserializer. + + :param dict classes: Class type dictionary for deserializing complex types. + :ivar list key_extractors: Ordered list of extractors to be used by this deserializer. + """ + + basic_types = {str: "str", int: "int", bool: "bool", float: "float"} + + valid_date = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") + + def __init__(self, classes: Optional[Mapping[str, type]] = None): + self.deserialize_type = { + "iso-8601": Deserializer.deserialize_iso, + "rfc-1123": Deserializer.deserialize_rfc, + "unix-time": Deserializer.deserialize_unix, + "duration": Deserializer.deserialize_duration, + "date": Deserializer.deserialize_date, + "time": Deserializer.deserialize_time, + "decimal": Deserializer.deserialize_decimal, + "long": Deserializer.deserialize_long, + "bytearray": Deserializer.deserialize_bytearray, + "base64": Deserializer.deserialize_base64, + "object": self.deserialize_object, + "[]": self.deserialize_iter, + "{}": self.deserialize_dict, + } + self.deserialize_expected_types = { + "duration": (isodate.Duration, datetime.timedelta), + "iso-8601": (datetime.datetime), + } + self.dependencies: Dict[str, type] = dict(classes) if classes else {} + self.key_extractors = [rest_key_extractor, xml_key_extractor] + # Additional properties only works if the "rest_key_extractor" is used to + # extract the keys. Making it to work whatever the key extractor is too much + # complicated, with no real scenario for now. + # So adding a flag to disable additional properties detection. This flag should be + # used if your expect the deserialization to NOT come from a JSON REST syntax. + # Otherwise, result are unexpected + self.additional_properties_detection = True + + def __call__(self, target_obj, response_data, content_type=None): + """Call the deserializer to process a REST response. + + :param str target_obj: Target data type to deserialize to. + :param requests.Response response_data: REST response object. + :param str content_type: Swagger "produces" if available. + :raises: DeserializationError if deserialization fails. + :return: Deserialized object. + :rtype: object + """ + data = self._unpack_content(response_data, content_type) + return self._deserialize(target_obj, data) + + def _deserialize(self, target_obj, data): # pylint: disable=inconsistent-return-statements + """Call the deserializer on a model. + + Data needs to be already deserialized as JSON or XML ElementTree + + :param str target_obj: Target data type to deserialize to. + :param object data: Object to deserialize. + :raises: DeserializationError if deserialization fails. + :return: Deserialized object. + :rtype: object + """ + # This is already a model, go recursive just in case + if hasattr(data, "_attribute_map"): + constants = [name for name, config in getattr(data, "_validation", {}).items() if config.get("constant")] + try: + for attr, mapconfig in data._attribute_map.items(): # pylint: disable=protected-access + if attr in constants: + continue + value = getattr(data, attr) + if value is None: + continue + local_type = mapconfig["type"] + internal_data_type = local_type.strip("[]{}") + if internal_data_type not in self.dependencies or isinstance(internal_data_type, Enum): + continue + setattr(data, attr, self._deserialize(local_type, value)) + return data + except AttributeError: + return + + response, class_name = self._classify_target(target_obj, data) + + if isinstance(response, str): + return self.deserialize_data(data, response) + if isinstance(response, type) and issubclass(response, Enum): + return self.deserialize_enum(data, response) + + if data is None or data is CoreNull: + return data + try: + attributes = response._attribute_map # type: ignore # pylint: disable=protected-access + d_attrs = {} + for attr, attr_desc in attributes.items(): + # Check empty string. If it's not empty, someone has a real "additionalProperties"... + if attr == "additional_properties" and attr_desc["key"] == "": + continue + raw_value = None + # Enhance attr_desc with some dynamic data + attr_desc = attr_desc.copy() # Do a copy, do not change the real one + internal_data_type = attr_desc["type"].strip("[]{}") + if internal_data_type in self.dependencies: + attr_desc["internalType"] = self.dependencies[internal_data_type] + + for key_extractor in self.key_extractors: + found_value = key_extractor(attr, attr_desc, data) + if found_value is not None: + if raw_value is not None and raw_value != found_value: + msg = ( + "Ignoring extracted value '%s' from %s for key '%s'" + " (duplicate extraction, follow extractors order)" + ) + _LOGGER.warning(msg, found_value, key_extractor, attr) + continue + raw_value = found_value + + value = self.deserialize_data(raw_value, attr_desc["type"]) + d_attrs[attr] = value + except (AttributeError, TypeError, KeyError) as err: + msg = "Unable to deserialize to object: " + class_name # type: ignore + raise DeserializationError(msg) from err + additional_properties = self._build_additional_properties(attributes, data) + return self._instantiate_model(response, d_attrs, additional_properties) + + def _build_additional_properties(self, attribute_map, data): + if not self.additional_properties_detection: + return None + if "additional_properties" in attribute_map and attribute_map.get("additional_properties", {}).get("key") != "": + # Check empty string. If it's not empty, someone has a real "additionalProperties" + return None + if isinstance(data, ET.Element): + data = {el.tag: el.text for el in data} + + known_keys = { + _decode_attribute_map_key(_FLATTEN.split(desc["key"])[0]) + for desc in attribute_map.values() + if desc["key"] != "" + } + present_keys = set(data.keys()) + missing_keys = present_keys - known_keys + return {key: data[key] for key in missing_keys} + + def _classify_target(self, target, data): + """Check to see whether the deserialization target object can + be classified into a subclass. + Once classification has been determined, initialize object. + + :param str target: The target object type to deserialize to. + :param str/dict data: The response data to deserialize. + :return: The classified target object and its class name. + :rtype: tuple + """ + if target is None: + return None, None + + if isinstance(target, str): + try: + target = self.dependencies[target] + except KeyError: + return target, target + + try: + target = target._classify(data, self.dependencies) # type: ignore # pylint: disable=protected-access + except AttributeError: + pass # Target is not a Model, no classify + return target, target.__class__.__name__ # type: ignore + + def failsafe_deserialize(self, target_obj, data, content_type=None): + """Ignores any errors encountered in deserialization, + and falls back to not deserializing the object. Recommended + for use in error deserialization, as we want to return the + HttpResponseError to users, and not have them deal with + a deserialization error. + + :param str target_obj: The target object type to deserialize to. + :param str/dict data: The response data to deserialize. + :param str content_type: Swagger "produces" if available. + :return: Deserialized object. + :rtype: object + """ + try: + return self(target_obj, data, content_type=content_type) + except: # pylint: disable=bare-except + _LOGGER.debug( + "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True + ) + return None + + @staticmethod + def _unpack_content(raw_data, content_type=None): + """Extract the correct structure for deserialization. + + If raw_data is a PipelineResponse, try to extract the result of RawDeserializer. + if we can't, raise. Your Pipeline should have a RawDeserializer. + + If not a pipeline response and raw_data is bytes or string, use content-type + to decode it. If no content-type, try JSON. + + If raw_data is something else, bypass all logic and return it directly. + + :param obj raw_data: Data to be processed. + :param str content_type: How to parse if raw_data is a string/bytes. + :raises JSONDecodeError: If JSON is requested and parsing is impossible. + :raises UnicodeDecodeError: If bytes is not UTF8 + :rtype: object + :return: Unpacked content. + """ + # Assume this is enough to detect a Pipeline Response without importing it + context = getattr(raw_data, "context", {}) + if context: + if RawDeserializer.CONTEXT_NAME in context: + return context[RawDeserializer.CONTEXT_NAME] + raise ValueError("This pipeline didn't have the RawDeserializer policy; can't deserialize") + + # Assume this is enough to recognize universal_http.ClientResponse without importing it + if hasattr(raw_data, "body"): + return RawDeserializer.deserialize_from_http_generics(raw_data.text(), raw_data.headers) + + # Assume this enough to recognize requests.Response without importing it. + if hasattr(raw_data, "_content_consumed"): + return RawDeserializer.deserialize_from_http_generics(raw_data.text, raw_data.headers) + + if isinstance(raw_data, (str, bytes)) or hasattr(raw_data, "read"): + return RawDeserializer.deserialize_from_text(raw_data, content_type) # type: ignore + return raw_data + + def _instantiate_model(self, response, attrs, additional_properties=None): + """Instantiate a response model passing in deserialized args. + + :param Response response: The response model class. + :param dict attrs: The deserialized response attributes. + :param dict additional_properties: Additional properties to be set. + :rtype: Response + :return: The instantiated response model. + """ + if callable(response): + subtype = getattr(response, "_subtype_map", {}) + try: + readonly = [ + k for k, v in response._validation.items() if v.get("readonly") # pylint: disable=protected-access + ] + const = [ + k for k, v in response._validation.items() if v.get("constant") # pylint: disable=protected-access + ] + kwargs = {k: v for k, v in attrs.items() if k not in subtype and k not in readonly + const} + response_obj = response(**kwargs) + for attr in readonly: + setattr(response_obj, attr, attrs.get(attr)) + if additional_properties: + response_obj.additional_properties = additional_properties + return response_obj + except TypeError as err: + msg = "Unable to deserialize {} into model {}. ".format(kwargs, response) # type: ignore + raise DeserializationError(msg + str(err)) from err + else: + try: + for attr, value in attrs.items(): + setattr(response, attr, value) + return response + except Exception as exp: + msg = "Unable to populate response model. " + msg += "Type: {}, Error: {}".format(type(response), exp) + raise DeserializationError(msg) from exp + + def deserialize_data(self, data, data_type): # pylint: disable=too-many-return-statements + """Process data for deserialization according to data type. + + :param str data: The response string to be deserialized. + :param str data_type: The type to deserialize to. + :raises: DeserializationError if deserialization fails. + :return: Deserialized object. + :rtype: object + """ + if data is None: + return data + + try: + if not data_type: + return data + if data_type in self.basic_types.values(): + return self.deserialize_basic(data, data_type) + if data_type in self.deserialize_type: + if isinstance(data, self.deserialize_expected_types.get(data_type, tuple())): + return data + + is_a_text_parsing_type = lambda x: x not in [ # pylint: disable=unnecessary-lambda-assignment + "object", + "[]", + r"{}", + ] + if isinstance(data, ET.Element) and is_a_text_parsing_type(data_type) and not data.text: + return None + data_val = self.deserialize_type[data_type](data) + return data_val + + iter_type = data_type[0] + data_type[-1] + if iter_type in self.deserialize_type: + return self.deserialize_type[iter_type](data, data_type[1:-1]) + + obj_type = self.dependencies[data_type] + if issubclass(obj_type, Enum): + if isinstance(data, ET.Element): + data = data.text + return self.deserialize_enum(data, obj_type) + + except (ValueError, TypeError, AttributeError) as err: + msg = "Unable to deserialize response data." + msg += " Data: {}, {}".format(data, data_type) + raise DeserializationError(msg) from err + return self._deserialize(obj_type, data) + + def deserialize_iter(self, attr, iter_type): + """Deserialize an iterable. + + :param list attr: Iterable to be deserialized. + :param str iter_type: The type of object in the iterable. + :return: Deserialized iterable. + :rtype: list + """ + if attr is None: + return None + if isinstance(attr, ET.Element): # If I receive an element here, get the children + attr = list(attr) + if not isinstance(attr, (list, set)): + raise DeserializationError("Cannot deserialize as [{}] an object of type {}".format(iter_type, type(attr))) + return [self.deserialize_data(a, iter_type) for a in attr] + + def deserialize_dict(self, attr, dict_type): + """Deserialize a dictionary. + + :param dict/list attr: Dictionary to be deserialized. Also accepts + a list of key, value pairs. + :param str dict_type: The object type of the items in the dictionary. + :return: Deserialized dictionary. + :rtype: dict + """ + if isinstance(attr, list): + return {x["key"]: self.deserialize_data(x["value"], dict_type) for x in attr} + + if isinstance(attr, ET.Element): + # Transform value into {"Key": "value"} + attr = {el.tag: el.text for el in attr} + return {k: self.deserialize_data(v, dict_type) for k, v in attr.items()} + + def deserialize_object(self, attr, **kwargs): # pylint: disable=too-many-return-statements + """Deserialize a generic object. + This will be handled as a dictionary. + + :param dict attr: Dictionary to be deserialized. + :return: Deserialized object. + :rtype: dict + :raises: TypeError if non-builtin datatype encountered. + """ + if attr is None: + return None + if isinstance(attr, ET.Element): + # Do no recurse on XML, just return the tree as-is + return attr + if isinstance(attr, str): + return self.deserialize_basic(attr, "str") + obj_type = type(attr) + if obj_type in self.basic_types: + return self.deserialize_basic(attr, self.basic_types[obj_type]) + if obj_type is _long_type: + return self.deserialize_long(attr) + + if obj_type == dict: + deserialized = {} + for key, value in attr.items(): + try: + deserialized[key] = self.deserialize_object(value, **kwargs) + except ValueError: + deserialized[key] = None + return deserialized + + if obj_type == list: + deserialized = [] + for obj in attr: + try: + deserialized.append(self.deserialize_object(obj, **kwargs)) + except ValueError: + pass + return deserialized + + error = "Cannot deserialize generic object with type: " + raise TypeError(error + str(obj_type)) + + def deserialize_basic(self, attr, data_type): # pylint: disable=too-many-return-statements + """Deserialize basic builtin data type from string. + Will attempt to convert to str, int, float and bool. + This function will also accept '1', '0', 'true' and 'false' as + valid bool values. + + :param str attr: response string to be deserialized. + :param str data_type: deserialization data type. + :return: Deserialized basic type. + :rtype: str, int, float or bool + :raises: TypeError if string format is not valid. + """ + # If we're here, data is supposed to be a basic type. + # If it's still an XML node, take the text + if isinstance(attr, ET.Element): + attr = attr.text + if not attr: + if data_type == "str": + # None or '', node is empty string. + return "" + # None or '', node with a strong type is None. + # Don't try to model "empty bool" or "empty int" + return None + + if data_type == "bool": + if attr in [True, False, 1, 0]: + return bool(attr) + if isinstance(attr, str): + if attr.lower() in ["true", "1"]: + return True + if attr.lower() in ["false", "0"]: + return False + raise TypeError("Invalid boolean value: {}".format(attr)) + + if data_type == "str": + return self.deserialize_unicode(attr) + return eval(data_type)(attr) # nosec # pylint: disable=eval-used + + @staticmethod + def deserialize_unicode(data): + """Preserve unicode objects in Python 2, otherwise return data + as a string. + + :param str data: response string to be deserialized. + :return: Deserialized string. + :rtype: str or unicode + """ + # We might be here because we have an enum modeled as string, + # and we try to deserialize a partial dict with enum inside + if isinstance(data, Enum): + return data + + # Consider this is real string + try: + if isinstance(data, unicode): # type: ignore + return data + except NameError: + return str(data) + return str(data) + + @staticmethod + def deserialize_enum(data, enum_obj): + """Deserialize string into enum object. + + If the string is not a valid enum value it will be returned as-is + and a warning will be logged. + + :param str data: Response string to be deserialized. If this value is + None or invalid it will be returned as-is. + :param Enum enum_obj: Enum object to deserialize to. + :return: Deserialized enum object. + :rtype: Enum + """ + if isinstance(data, enum_obj) or data is None: + return data + if isinstance(data, Enum): + data = data.value + if isinstance(data, int): + # Workaround. We might consider remove it in the future. + try: + return list(enum_obj.__members__.values())[data] + except IndexError as exc: + error = "{!r} is not a valid index for enum {!r}" + raise DeserializationError(error.format(data, enum_obj)) from exc + try: + return enum_obj(str(data)) + except ValueError: + for enum_value in enum_obj: + if enum_value.value.lower() == str(data).lower(): + return enum_value + # We don't fail anymore for unknown value, we deserialize as a string + _LOGGER.warning("Deserializer is not able to find %s as valid enum in %s", data, enum_obj) + return Deserializer.deserialize_unicode(data) + + @staticmethod + def deserialize_bytearray(attr): + """Deserialize string into bytearray. + + :param str attr: response string to be deserialized. + :return: Deserialized bytearray + :rtype: bytearray + :raises: TypeError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + return bytearray(b64decode(attr)) # type: ignore + + @staticmethod + def deserialize_base64(attr): + """Deserialize base64 encoded string into string. + + :param str attr: response string to be deserialized. + :return: Deserialized base64 string + :rtype: bytearray + :raises: TypeError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + padding = "=" * (3 - (len(attr) + 3) % 4) # type: ignore + attr = attr + padding # type: ignore + encoded = attr.replace("-", "+").replace("_", "/") + return b64decode(encoded) + + @staticmethod + def deserialize_decimal(attr): + """Deserialize string into Decimal object. + + :param str attr: response string to be deserialized. + :return: Deserialized decimal + :raises: DeserializationError if string format invalid. + :rtype: decimal + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + return decimal.Decimal(str(attr)) # type: ignore + except decimal.DecimalException as err: + msg = "Invalid decimal {}".format(attr) + raise DeserializationError(msg) from err + + @staticmethod + def deserialize_long(attr): + """Deserialize string into long (Py2) or int (Py3). + + :param str attr: response string to be deserialized. + :return: Deserialized int + :rtype: long or int + :raises: ValueError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + return _long_type(attr) # type: ignore + + @staticmethod + def deserialize_duration(attr): + """Deserialize ISO-8601 formatted string into TimeDelta object. + + :param str attr: response string to be deserialized. + :return: Deserialized duration + :rtype: TimeDelta + :raises: DeserializationError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + duration = isodate.parse_duration(attr) + except (ValueError, OverflowError, AttributeError) as err: + msg = "Cannot deserialize duration object." + raise DeserializationError(msg) from err + return duration + + @staticmethod + def deserialize_date(attr): + """Deserialize ISO-8601 formatted string into Date object. + + :param str attr: response string to be deserialized. + :return: Deserialized date + :rtype: Date + :raises: DeserializationError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + if re.search(r"[^\W\d_]", attr, re.I + re.U): # type: ignore + raise DeserializationError("Date must have only digits and -. Received: %s" % attr) + # This must NOT use defaultmonth/defaultday. Using None ensure this raises an exception. + return isodate.parse_date(attr, defaultmonth=0, defaultday=0) + + @staticmethod + def deserialize_time(attr): + """Deserialize ISO-8601 formatted string into time object. + + :param str attr: response string to be deserialized. + :return: Deserialized time + :rtype: datetime.time + :raises: DeserializationError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + if re.search(r"[^\W\d_]", attr, re.I + re.U): # type: ignore + raise DeserializationError("Date must have only digits and -. Received: %s" % attr) + return isodate.parse_time(attr) + + @staticmethod + def deserialize_rfc(attr): + """Deserialize RFC-1123 formatted string into Datetime object. + + :param str attr: response string to be deserialized. + :return: Deserialized RFC datetime + :rtype: Datetime + :raises: DeserializationError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + parsed_date = email.utils.parsedate_tz(attr) # type: ignore + date_obj = datetime.datetime( + *parsed_date[:6], tzinfo=_FixedOffset(datetime.timedelta(minutes=(parsed_date[9] or 0) / 60)) + ) + if not date_obj.tzinfo: + date_obj = date_obj.astimezone(tz=TZ_UTC) + except ValueError as err: + msg = "Cannot deserialize to rfc datetime object." + raise DeserializationError(msg) from err + return date_obj + + @staticmethod + def deserialize_iso(attr): + """Deserialize ISO-8601 formatted string into Datetime object. + + :param str attr: response string to be deserialized. + :return: Deserialized ISO datetime + :rtype: Datetime + :raises: DeserializationError if string format invalid. + """ + if isinstance(attr, ET.Element): + attr = attr.text + try: + attr = attr.upper() # type: ignore + match = Deserializer.valid_date.match(attr) + if not match: + raise ValueError("Invalid datetime string: " + attr) + + check_decimal = attr.split(".") + if len(check_decimal) > 1: + decimal_str = "" + for digit in check_decimal[1]: + if digit.isdigit(): + decimal_str += digit + else: + break + if len(decimal_str) > 6: + attr = attr.replace(decimal_str, decimal_str[0:6]) + + date_obj = isodate.parse_datetime(attr) + test_utc = date_obj.utctimetuple() + if test_utc.tm_year > 9999 or test_utc.tm_year < 1: + raise OverflowError("Hit max or min date") + except (ValueError, OverflowError, AttributeError) as err: + msg = "Cannot deserialize datetime object." + raise DeserializationError(msg) from err + return date_obj + + @staticmethod + def deserialize_unix(attr): + """Serialize Datetime object into IntTime format. + This is represented as seconds. + + :param int attr: Object to be serialized. + :return: Deserialized datetime + :rtype: Datetime + :raises: DeserializationError if format invalid + """ + if isinstance(attr, ET.Element): + attr = int(attr.text) # type: ignore + try: + attr = int(attr) + date_obj = datetime.datetime.fromtimestamp(attr, TZ_UTC) + except ValueError as err: + msg = "Cannot deserialize to unix datetime object." + raise DeserializationError(msg) from err + return date_obj diff --git a/packages/typespec-python/test/unbranded/generated/routes/routes/_vendor.py b/packages/typespec-python/test/unbranded/generated/routes/routes/_vendor.py new file mode 100644 index 00000000000..2b0992a70cf --- /dev/null +++ b/packages/typespec-python/test/unbranded/generated/routes/routes/_vendor.py @@ -0,0 +1,26 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Unbranded Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Unbranded (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from abc import ABC +from typing import TYPE_CHECKING + +from ._configuration import RoutesClientConfiguration + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from corehttp.runtime import PipelineClient + + from ._serialization import Deserializer, Serializer + + +class RoutesClientMixinABC(ABC): + """DO NOT use this class. It is for internal typing use only.""" + + _client: "PipelineClient" + _config: RoutesClientConfiguration + _serialize: "Serializer" + _deserialize: "Deserializer" diff --git a/packages/typespec-python/test/unbranded/generated/routes/routes/_version.py b/packages/typespec-python/test/unbranded/generated/routes/routes/_version.py new file mode 100644 index 00000000000..2a6e487ad06 --- /dev/null +++ b/packages/typespec-python/test/unbranded/generated/routes/routes/_version.py @@ -0,0 +1,9 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Unbranded Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Unbranded (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +VERSION = "1.0.0b1" diff --git a/packages/typespec-python/test/unbranded/generated/routes/routes/aio/__init__.py b/packages/typespec-python/test/unbranded/generated/routes/routes/aio/__init__.py new file mode 100644 index 00000000000..824b161b7c5 --- /dev/null +++ b/packages/typespec-python/test/unbranded/generated/routes/routes/aio/__init__.py @@ -0,0 +1,23 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Unbranded Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Unbranded (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._client import RoutesClient + +try: + from ._patch import __all__ as _patch_all + from ._patch import * # pylint: disable=unused-wildcard-import +except ImportError: + _patch_all = [] +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "RoutesClient", +] +__all__.extend([p for p in _patch_all if p not in __all__]) + +_patch_sdk() diff --git a/packages/typespec-python/test/unbranded/generated/routes/routes/aio/_client.py b/packages/typespec-python/test/unbranded/generated/routes/routes/aio/_client.py new file mode 100644 index 00000000000..974429d89ef --- /dev/null +++ b/packages/typespec-python/test/unbranded/generated/routes/routes/aio/_client.py @@ -0,0 +1,102 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Unbranded Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Unbranded (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from copy import deepcopy +from typing import Any, Awaitable +from typing_extensions import Self + +from corehttp.rest import AsyncHttpResponse, HttpRequest +from corehttp.runtime import AsyncPipelineClient, policies + +from .._serialization import Deserializer, Serializer +from ._configuration import RoutesClientConfiguration +from .operations import ( + InInterfaceOperations, + PathParametersOperations, + QueryParametersOperations, + RoutesClientOperationsMixin, +) + + +class RoutesClient(RoutesClientOperationsMixin): # pylint: disable=client-accepts-api-version-keyword + """Define scenario in building the http route/uri. + + :ivar path_parameters: PathParametersOperations operations + :vartype path_parameters: routes.aio.operations.PathParametersOperations + :ivar query_parameters: QueryParametersOperations operations + :vartype query_parameters: routes.aio.operations.QueryParametersOperations + :ivar in_interface: InInterfaceOperations operations + :vartype in_interface: routes.aio.operations.InInterfaceOperations + :keyword endpoint: Service host. Default value is "http://localhost:3000". + :paramtype endpoint: str + """ + + def __init__( # pylint: disable=missing-client-constructor-parameter-credential + self, *, endpoint: str = "http://localhost:3000", **kwargs: Any + ) -> None: + _endpoint = "{endpoint}" + self._config = RoutesClientConfiguration(endpoint=endpoint, **kwargs) + _policies = kwargs.pop("policies", None) + if _policies is None: + _policies = [ + self._config.headers_policy, + self._config.user_agent_policy, + self._config.proxy_policy, + policies.ContentDecodePolicy(**kwargs), + self._config.retry_policy, + self._config.authentication_policy, + self._config.logging_policy, + ] + self._client: AsyncPipelineClient = AsyncPipelineClient(endpoint=_endpoint, policies=_policies, **kwargs) + + self._serialize = Serializer() + self._deserialize = Deserializer() + self._serialize.client_side_validation = False + self.path_parameters = PathParametersOperations(self._client, self._config, self._serialize, self._deserialize) + self.query_parameters = QueryParametersOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.in_interface = InInterfaceOperations(self._client, self._config, self._serialize, self._deserialize) + + def send_request( + self, request: HttpRequest, *, stream: bool = False, **kwargs: Any + ) -> Awaitable[AsyncHttpResponse]: + """Runs the network request through the client's chained policies. + + >>> from corehttp.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = await client.send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request + + :param request: The network request you want to make. Required. + :type request: ~corehttp.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~corehttp.rest.AsyncHttpResponse + """ + + request_copy = deepcopy(request) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + } + + request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) + return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore + + async def close(self) -> None: + await self._client.close() + + async def __aenter__(self) -> Self: + await self._client.__aenter__() + return self + + async def __aexit__(self, *exc_details: Any) -> None: + await self._client.__aexit__(*exc_details) diff --git a/packages/typespec-python/test/unbranded/generated/routes/routes/aio/_configuration.py b/packages/typespec-python/test/unbranded/generated/routes/routes/aio/_configuration.py new file mode 100644 index 00000000000..8c18d41cde9 --- /dev/null +++ b/packages/typespec-python/test/unbranded/generated/routes/routes/aio/_configuration.py @@ -0,0 +1,39 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Unbranded Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Unbranded (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any + +from corehttp.runtime import policies + +from .._version import VERSION + + +class RoutesClientConfiguration: # pylint: disable=too-many-instance-attributes + """Configuration for RoutesClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param endpoint: Service host. Default value is "http://localhost:3000". + :type endpoint: str + """ + + def __init__(self, endpoint: str = "http://localhost:3000", **kwargs: Any) -> None: + + self.endpoint = endpoint + kwargs.setdefault("sdk_moniker", "routes/{}".format(VERSION)) + self.polling_interval = kwargs.get("polling_interval", 30) + self._configure(**kwargs) + + def _configure(self, **kwargs: Any) -> None: + self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs) + self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs) + self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs) + self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs) + self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs) + self.authentication_policy = kwargs.get("authentication_policy") diff --git a/packages/typespec-python/test/unbranded/generated/routes/routes/aio/_patch.py b/packages/typespec-python/test/unbranded/generated/routes/routes/aio/_patch.py new file mode 100644 index 00000000000..cc9d8be1c50 --- /dev/null +++ b/packages/typespec-python/test/unbranded/generated/routes/routes/aio/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Unbranded Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/unbranded/generated/routes/routes/aio/_vendor.py b/packages/typespec-python/test/unbranded/generated/routes/routes/aio/_vendor.py new file mode 100644 index 00000000000..b8940d79aee --- /dev/null +++ b/packages/typespec-python/test/unbranded/generated/routes/routes/aio/_vendor.py @@ -0,0 +1,26 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Unbranded Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Unbranded (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from abc import ABC +from typing import TYPE_CHECKING + +from ._configuration import RoutesClientConfiguration + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from corehttp.runtime import AsyncPipelineClient + + from .._serialization import Deserializer, Serializer + + +class RoutesClientMixinABC(ABC): + """DO NOT use this class. It is for internal typing use only.""" + + _client: "AsyncPipelineClient" + _config: RoutesClientConfiguration + _serialize: "Serializer" + _deserialize: "Deserializer" diff --git a/packages/typespec-python/test/unbranded/generated/routes/routes/aio/operations/__init__.py b/packages/typespec-python/test/unbranded/generated/routes/routes/aio/operations/__init__.py new file mode 100644 index 00000000000..7e4a93bb97e --- /dev/null +++ b/packages/typespec-python/test/unbranded/generated/routes/routes/aio/operations/__init__.py @@ -0,0 +1,25 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Unbranded Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Unbranded (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._operations import PathParametersOperations +from ._operations import QueryParametersOperations +from ._operations import InInterfaceOperations +from ._operations import RoutesClientOperationsMixin + +from ._patch import __all__ as _patch_all +from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "PathParametersOperations", + "QueryParametersOperations", + "InInterfaceOperations", + "RoutesClientOperationsMixin", +] +__all__.extend([p for p in _patch_all if p not in __all__]) +_patch_sdk() diff --git a/packages/typespec-python/test/unbranded/generated/routes/routes/aio/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/routes/routes/aio/operations/_operations.py new file mode 100644 index 00000000000..7923d04ab8d --- /dev/null +++ b/packages/typespec-python/test/unbranded/generated/routes/routes/aio/operations/_operations.py @@ -0,0 +1,2682 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Unbranded Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Unbranded (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, List, Optional, Type, TypeVar + +from corehttp.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from corehttp.rest import AsyncHttpResponse, HttpRequest +from corehttp.runtime.pipeline import PipelineResponse + +from ...operations._operations import ( + build_in_interface_fixed_request, + build_path_parameters_annotation_only_request, + build_path_parameters_explicit_request, + build_path_parameters_label_expansion_explode_array_request, + build_path_parameters_label_expansion_explode_primitive_request, + build_path_parameters_label_expansion_explode_record_request, + build_path_parameters_label_expansion_standard_array_request, + build_path_parameters_label_expansion_standard_primitive_request, + build_path_parameters_label_expansion_standard_record_request, + build_path_parameters_matrix_expansion_explode_array_request, + build_path_parameters_matrix_expansion_explode_primitive_request, + build_path_parameters_matrix_expansion_explode_record_request, + build_path_parameters_matrix_expansion_standard_array_request, + build_path_parameters_matrix_expansion_standard_primitive_request, + build_path_parameters_matrix_expansion_standard_record_request, + build_path_parameters_path_expansion_explode_array_request, + build_path_parameters_path_expansion_explode_primitive_request, + build_path_parameters_path_expansion_explode_record_request, + build_path_parameters_path_expansion_standard_array_request, + build_path_parameters_path_expansion_standard_primitive_request, + build_path_parameters_path_expansion_standard_record_request, + build_path_parameters_reserved_expansion_annotation_request, + build_path_parameters_reserved_expansion_template_request, + build_path_parameters_simple_expansion_explode_array_request, + build_path_parameters_simple_expansion_explode_primitive_request, + build_path_parameters_simple_expansion_explode_record_request, + build_path_parameters_simple_expansion_standard_array_request, + build_path_parameters_simple_expansion_standard_primitive_request, + build_path_parameters_simple_expansion_standard_record_request, + build_path_parameters_template_only_request, + build_query_parameters_annotation_only_request, + build_query_parameters_explicit_request, + build_query_parameters_query_continuation_explode_array_request, + build_query_parameters_query_continuation_explode_primitive_request, + build_query_parameters_query_continuation_explode_record_request, + build_query_parameters_query_continuation_standard_array_request, + build_query_parameters_query_continuation_standard_primitive_request, + build_query_parameters_query_continuation_standard_record_request, + build_query_parameters_query_expansion_explode_array_request, + build_query_parameters_query_expansion_explode_primitive_request, + build_query_parameters_query_expansion_explode_record_request, + build_query_parameters_query_expansion_standard_array_request, + build_query_parameters_query_expansion_standard_primitive_request, + build_query_parameters_query_expansion_standard_record_request, + build_query_parameters_template_only_request, + build_routes_fixed_request, +) +from .._vendor import RoutesClientMixinABC + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class PathParametersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.aio.RoutesClient`'s + :attr:`path_parameters` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + self.reserved_expansion = PathParametersReservedExpansionOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.simple_expansion = PathParametersSimpleExpansionOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.path_expansion = PathParametersPathExpansionOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.label_expansion = PathParametersLabelExpansionOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.matrix_expansion = PathParametersMatrixExpansionOperations( + self._client, self._config, self._serialize, self._deserialize + ) + + async def template_only(self, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """template_only. + + :param param: Required. + :type param: str + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_template_only_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + async def explicit(self, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """explicit. + + :param param: Required. + :type param: str + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_explicit_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + async def annotation_only( # pylint: disable=inconsistent-return-statements + self, param: str, **kwargs: Any + ) -> None: + """annotation_only. + + :param param: Required. + :type param: str + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_annotation_only_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class QueryParametersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.aio.RoutesClient`'s + :attr:`query_parameters` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + self.query_expansion = QueryParametersQueryExpansionOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.query_continuation = QueryParametersQueryContinuationOperations( + self._client, self._config, self._serialize, self._deserialize + ) + + async def template_only( # pylint: disable=inconsistent-return-statements + self, *, param: str, **kwargs: Any + ) -> None: + """template_only. + + :keyword param: Required. + :paramtype param: str + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_template_only_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + async def explicit(self, *, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """explicit. + + :keyword param: Required. + :paramtype param: str + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_explicit_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + async def annotation_only( # pylint: disable=inconsistent-return-statements + self, *, param: str, **kwargs: Any + ) -> None: + """annotation_only. + + :keyword param: Required. + :paramtype param: str + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_annotation_only_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class InInterfaceOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.aio.RoutesClient`'s + :attr:`in_interface` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + async def fixed(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """fixed. + + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_in_interface_fixed_request( + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class RoutesClientOperationsMixin(RoutesClientMixinABC): + + async def fixed(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """fixed. + + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_routes_fixed_request( + 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 = False + pipeline_response: PipelineResponse = await self._client.pipeline.run( # type: ignore # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class PathParametersReservedExpansionOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.aio.RoutesClient`'s + :attr:`reserved_expansion` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + async def template(self, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """template. + + :param param: Required. + :type param: str + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_reserved_expansion_template_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + async def annotation(self, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """annotation. + + :param param: Required. + :type param: str + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_reserved_expansion_annotation_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class PathParametersSimpleExpansionOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.aio.RoutesClient`'s + :attr:`simple_expansion` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + self.standard = PathParametersSimpleExpansionStandardOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.explode = PathParametersSimpleExpansionExplodeOperations( + self._client, self._config, self._serialize, self._deserialize + ) + + +class PathParametersPathExpansionOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.aio.RoutesClient`'s + :attr:`path_expansion` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + self.standard = PathParametersPathExpansionStandardOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.explode = PathParametersPathExpansionExplodeOperations( + self._client, self._config, self._serialize, self._deserialize + ) + + +class PathParametersLabelExpansionOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.aio.RoutesClient`'s + :attr:`label_expansion` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + self.standard = PathParametersLabelExpansionStandardOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.explode = PathParametersLabelExpansionExplodeOperations( + self._client, self._config, self._serialize, self._deserialize + ) + + +class PathParametersMatrixExpansionOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.aio.RoutesClient`'s + :attr:`matrix_expansion` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + self.standard = PathParametersMatrixExpansionStandardOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.explode = PathParametersMatrixExpansionExplodeOperations( + self._client, self._config, self._serialize, self._deserialize + ) + + +class QueryParametersQueryExpansionOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.aio.RoutesClient`'s + :attr:`query_expansion` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + self.standard = QueryParametersQueryExpansionStandardOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.explode = QueryParametersQueryExpansionExplodeOperations( + self._client, self._config, self._serialize, self._deserialize + ) + + +class QueryParametersQueryContinuationOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.aio.RoutesClient`'s + :attr:`query_continuation` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + self.standard = QueryParametersQueryContinuationStandardOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.explode = QueryParametersQueryContinuationExplodeOperations( + self._client, self._config, self._serialize, self._deserialize + ) + + +class PathParametersSimpleExpansionStandardOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.aio.RoutesClient`'s + :attr:`standard` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + async def primitive(self, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """primitive. + + :param param: Required. + :type param: str + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_simple_expansion_standard_primitive_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + async def array(self, param: List[str], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """array. + + :param param: Required. + :type param: list[str] + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_simple_expansion_standard_array_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + async def record( # pylint: disable=inconsistent-return-statements + self, param: Dict[str, int], **kwargs: Any + ) -> None: + """record. + + :param param: Required. + :type param: dict[str, int] + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_simple_expansion_standard_record_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class PathParametersSimpleExpansionExplodeOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.aio.RoutesClient`'s + :attr:`explode` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + async def primitive(self, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """primitive. + + :param param: Required. + :type param: str + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_simple_expansion_explode_primitive_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + async def array(self, param: List[str], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """array. + + :param param: Required. + :type param: list[str] + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_simple_expansion_explode_array_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + async def record( # pylint: disable=inconsistent-return-statements + self, param: Dict[str, int], **kwargs: Any + ) -> None: + """record. + + :param param: Required. + :type param: dict[str, int] + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_simple_expansion_explode_record_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class PathParametersPathExpansionStandardOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.aio.RoutesClient`'s + :attr:`standard` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + async def primitive(self, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """primitive. + + :param param: Required. + :type param: str + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_path_expansion_standard_primitive_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + async def array(self, param: List[str], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """array. + + :param param: Required. + :type param: list[str] + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_path_expansion_standard_array_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + async def record( # pylint: disable=inconsistent-return-statements + self, param: Dict[str, int], **kwargs: Any + ) -> None: + """record. + + :param param: Required. + :type param: dict[str, int] + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_path_expansion_standard_record_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class PathParametersPathExpansionExplodeOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.aio.RoutesClient`'s + :attr:`explode` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + async def primitive(self, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """primitive. + + :param param: Required. + :type param: str + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_path_expansion_explode_primitive_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + async def array(self, param: List[str], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """array. + + :param param: Required. + :type param: list[str] + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_path_expansion_explode_array_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + async def record( # pylint: disable=inconsistent-return-statements + self, param: Dict[str, int], **kwargs: Any + ) -> None: + """record. + + :param param: Required. + :type param: dict[str, int] + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_path_expansion_explode_record_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class PathParametersLabelExpansionStandardOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.aio.RoutesClient`'s + :attr:`standard` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + async def primitive(self, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """primitive. + + :param param: Required. + :type param: str + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_label_expansion_standard_primitive_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + async def array(self, param: List[str], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """array. + + :param param: Required. + :type param: list[str] + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_label_expansion_standard_array_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + async def record( # pylint: disable=inconsistent-return-statements + self, param: Dict[str, int], **kwargs: Any + ) -> None: + """record. + + :param param: Required. + :type param: dict[str, int] + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_label_expansion_standard_record_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class PathParametersLabelExpansionExplodeOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.aio.RoutesClient`'s + :attr:`explode` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + async def primitive(self, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """primitive. + + :param param: Required. + :type param: str + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_label_expansion_explode_primitive_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + async def array(self, param: List[str], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """array. + + :param param: Required. + :type param: list[str] + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_label_expansion_explode_array_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + async def record( # pylint: disable=inconsistent-return-statements + self, param: Dict[str, int], **kwargs: Any + ) -> None: + """record. + + :param param: Required. + :type param: dict[str, int] + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_label_expansion_explode_record_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class PathParametersMatrixExpansionStandardOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.aio.RoutesClient`'s + :attr:`standard` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + async def primitive(self, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """primitive. + + :param param: Required. + :type param: str + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_matrix_expansion_standard_primitive_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + async def array(self, param: List[str], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """array. + + :param param: Required. + :type param: list[str] + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_matrix_expansion_standard_array_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + async def record( # pylint: disable=inconsistent-return-statements + self, param: Dict[str, int], **kwargs: Any + ) -> None: + """record. + + :param param: Required. + :type param: dict[str, int] + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_matrix_expansion_standard_record_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class PathParametersMatrixExpansionExplodeOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.aio.RoutesClient`'s + :attr:`explode` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + async def primitive(self, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """primitive. + + :param param: Required. + :type param: str + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_matrix_expansion_explode_primitive_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + async def array(self, param: List[str], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """array. + + :param param: Required. + :type param: list[str] + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_matrix_expansion_explode_array_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + async def record( # pylint: disable=inconsistent-return-statements + self, param: Dict[str, int], **kwargs: Any + ) -> None: + """record. + + :param param: Required. + :type param: dict[str, int] + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_matrix_expansion_explode_record_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class QueryParametersQueryExpansionStandardOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.aio.RoutesClient`'s + :attr:`standard` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + async def primitive(self, *, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """primitive. + + :keyword param: Required. + :paramtype param: str + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_query_expansion_standard_primitive_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + async def array(self, *, param: List[str], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """array. + + :keyword param: Required. + :paramtype param: list[str] + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_query_expansion_standard_array_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + async def record( # pylint: disable=inconsistent-return-statements + self, *, param: Dict[str, int], **kwargs: Any + ) -> None: + """record. + + :keyword param: Required. + :paramtype param: dict[str, int] + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_query_expansion_standard_record_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class QueryParametersQueryExpansionExplodeOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.aio.RoutesClient`'s + :attr:`explode` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + async def primitive(self, *, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """primitive. + + :keyword param: Required. + :paramtype param: str + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_query_expansion_explode_primitive_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + async def array(self, *, param: List[str], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """array. + + :keyword param: Required. + :paramtype param: list[str] + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_query_expansion_explode_array_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + async def record( # pylint: disable=inconsistent-return-statements + self, *, param: Dict[str, int], **kwargs: Any + ) -> None: + """record. + + :keyword param: Required. + :paramtype param: dict[str, int] + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_query_expansion_explode_record_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class QueryParametersQueryContinuationStandardOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.aio.RoutesClient`'s + :attr:`standard` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + async def primitive(self, *, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """primitive. + + :keyword param: Required. + :paramtype param: str + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_query_continuation_standard_primitive_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + async def array(self, *, param: List[str], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """array. + + :keyword param: Required. + :paramtype param: list[str] + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_query_continuation_standard_array_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + async def record( # pylint: disable=inconsistent-return-statements + self, *, param: Dict[str, int], **kwargs: Any + ) -> None: + """record. + + :keyword param: Required. + :paramtype param: dict[str, int] + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_query_continuation_standard_record_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class QueryParametersQueryContinuationExplodeOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.aio.RoutesClient`'s + :attr:`explode` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + async def primitive(self, *, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """primitive. + + :keyword param: Required. + :paramtype param: str + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_query_continuation_explode_primitive_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + async def array(self, *, param: List[str], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """array. + + :keyword param: Required. + :paramtype param: list[str] + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_query_continuation_explode_array_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + async def record( # pylint: disable=inconsistent-return-statements + self, *, param: Dict[str, int], **kwargs: Any + ) -> None: + """record. + + :keyword param: Required. + :paramtype param: dict[str, int] + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_query_continuation_explode_record_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/unbranded/generated/routes/routes/aio/operations/_patch.py b/packages/typespec-python/test/unbranded/generated/routes/routes/aio/operations/_patch.py new file mode 100644 index 00000000000..cc9d8be1c50 --- /dev/null +++ b/packages/typespec-python/test/unbranded/generated/routes/routes/aio/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Unbranded Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/unbranded/generated/routes/routes/operations/__init__.py b/packages/typespec-python/test/unbranded/generated/routes/routes/operations/__init__.py new file mode 100644 index 00000000000..7e4a93bb97e --- /dev/null +++ b/packages/typespec-python/test/unbranded/generated/routes/routes/operations/__init__.py @@ -0,0 +1,25 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Unbranded Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Unbranded (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._operations import PathParametersOperations +from ._operations import QueryParametersOperations +from ._operations import InInterfaceOperations +from ._operations import RoutesClientOperationsMixin + +from ._patch import __all__ as _patch_all +from ._patch import * # pylint: disable=unused-wildcard-import +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "PathParametersOperations", + "QueryParametersOperations", + "InInterfaceOperations", + "RoutesClientOperationsMixin", +] +__all__.extend([p for p in _patch_all if p not in __all__]) +_patch_sdk() diff --git a/packages/typespec-python/test/unbranded/generated/routes/routes/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/routes/routes/operations/_operations.py new file mode 100644 index 00000000000..23a43bc0c27 --- /dev/null +++ b/packages/typespec-python/test/unbranded/generated/routes/routes/operations/_operations.py @@ -0,0 +1,3235 @@ +# pylint: disable=too-many-lines,too-many-statements +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Unbranded Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Unbranded (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import sys +from typing import Any, Callable, Dict, List, Optional, Type, TypeVar + +from corehttp.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + map_error, +) +from corehttp.rest import HttpRequest, HttpResponse +from corehttp.runtime.pipeline import PipelineResponse +from corehttp.utils import case_insensitive_dict + +from .._serialization import Serializer +from .._vendor import RoutesClientMixinABC + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_path_parameters_template_only_request( # pylint: disable=name-too-long + param: str, **kwargs: Any +) -> HttpRequest: + # Construct URL + _url = "/routes/path/template-only/{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +def build_path_parameters_explicit_request(param: str, **kwargs: Any) -> HttpRequest: + # Construct URL + _url = "/routes/path/explicit/{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +def build_path_parameters_annotation_only_request( # pylint: disable=name-too-long + param: str, **kwargs: Any +) -> HttpRequest: + # Construct URL + _url = "/routes/path/annotation-only/{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +def build_query_parameters_template_only_request( # pylint: disable=name-too-long + *, param: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + # Construct URL + _url = "/routes/query/template-only" + + # Construct parameters + _params["param"] = _SERIALIZER.query("param", param, "str") + + return HttpRequest(method="GET", url=_url, params=_params, **kwargs) + + +def build_query_parameters_explicit_request(*, param: str, **kwargs: Any) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + # Construct URL + _url = "/routes/query/explicit" + + # Construct parameters + _params["param"] = _SERIALIZER.query("param", param, "str") + + return HttpRequest(method="GET", url=_url, params=_params, **kwargs) + + +def build_query_parameters_annotation_only_request( # pylint: disable=name-too-long + *, param: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + # Construct URL + _url = "/routes/query/annotation-only" + + # Construct parameters + _params["param"] = _SERIALIZER.query("param", param, "str") + + return HttpRequest(method="GET", url=_url, params=_params, **kwargs) + + +def build_in_interface_fixed_request(**kwargs: Any) -> HttpRequest: + # Construct URL + _url = "/routes/in-interface/fixed" + + return HttpRequest(method="GET", url=_url, **kwargs) + + +def build_routes_fixed_request(**kwargs: Any) -> HttpRequest: + # Construct URL + _url = "/routes/fixed" + + return HttpRequest(method="GET", url=_url, **kwargs) + + +def build_path_parameters_reserved_expansion_template_request( # pylint: disable=name-too-long + param: str, **kwargs: Any +) -> HttpRequest: + # Construct URL + _url = "/routes/path/reserved-expansion/template/{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "str", skip_quote=True), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +def build_path_parameters_reserved_expansion_annotation_request( # pylint: disable=name-too-long + param: str, **kwargs: Any +) -> HttpRequest: + # Construct URL + _url = "/routes/path/reserved-expansion/annotation/{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "str", skip_quote=True), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +def build_path_parameters_simple_expansion_standard_primitive_request( # pylint: disable=name-too-long + param: str, **kwargs: Any +) -> HttpRequest: + # Construct URL + _url = "/routes/path/simple/standard/primitive{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +def build_path_parameters_simple_expansion_standard_array_request( # pylint: disable=name-too-long + param: List[str], **kwargs: Any +) -> HttpRequest: + # Construct URL + _url = "/routes/path/simple/standard/array{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "[str]"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +def build_path_parameters_simple_expansion_standard_record_request( # pylint: disable=name-too-long + param: Dict[str, int], **kwargs: Any +) -> HttpRequest: + # Construct URL + _url = "/routes/path/simple/standard/record{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "{int}"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +def build_path_parameters_simple_expansion_explode_primitive_request( # pylint: disable=name-too-long + param: str, **kwargs: Any +) -> HttpRequest: + # Construct URL + _url = "/routes/path/simple/explode/primitive{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +def build_path_parameters_simple_expansion_explode_array_request( # pylint: disable=name-too-long + param: List[str], **kwargs: Any +) -> HttpRequest: + # Construct URL + _url = "/routes/path/simple/explode/array{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "[str]"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +def build_path_parameters_simple_expansion_explode_record_request( # pylint: disable=name-too-long + param: Dict[str, int], **kwargs: Any +) -> HttpRequest: + # Construct URL + _url = "/routes/path/simple/explode/record{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "{int}"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +def build_path_parameters_path_expansion_standard_primitive_request( # pylint: disable=name-too-long + param: str, **kwargs: Any +) -> HttpRequest: + # Construct URL + _url = "/routes/path/path/standard/primitive{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +def build_path_parameters_path_expansion_standard_array_request( # pylint: disable=name-too-long + param: List[str], **kwargs: Any +) -> HttpRequest: + # Construct URL + _url = "/routes/path/path/standard/array{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "[str]"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +def build_path_parameters_path_expansion_standard_record_request( # pylint: disable=name-too-long + param: Dict[str, int], **kwargs: Any +) -> HttpRequest: + # Construct URL + _url = "/routes/path/path/standard/record{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "{int}"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +def build_path_parameters_path_expansion_explode_primitive_request( # pylint: disable=name-too-long + param: str, **kwargs: Any +) -> HttpRequest: + # Construct URL + _url = "/routes/path/path/explode/primitive{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +def build_path_parameters_path_expansion_explode_array_request( # pylint: disable=name-too-long + param: List[str], **kwargs: Any +) -> HttpRequest: + # Construct URL + _url = "/routes/path/path/explode/array{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "[str]"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +def build_path_parameters_path_expansion_explode_record_request( # pylint: disable=name-too-long + param: Dict[str, int], **kwargs: Any +) -> HttpRequest: + # Construct URL + _url = "/routes/path/path/explode/record{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "{int}"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +def build_path_parameters_label_expansion_standard_primitive_request( # pylint: disable=name-too-long + param: str, **kwargs: Any +) -> HttpRequest: + # Construct URL + _url = "/routes/path/label/standard/primitive{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +def build_path_parameters_label_expansion_standard_array_request( # pylint: disable=name-too-long + param: List[str], **kwargs: Any +) -> HttpRequest: + # Construct URL + _url = "/routes/path/label/standard/array{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "[str]"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +def build_path_parameters_label_expansion_standard_record_request( # pylint: disable=name-too-long + param: Dict[str, int], **kwargs: Any +) -> HttpRequest: + # Construct URL + _url = "/routes/path/label/standard/record{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "{int}"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +def build_path_parameters_label_expansion_explode_primitive_request( # pylint: disable=name-too-long + param: str, **kwargs: Any +) -> HttpRequest: + # Construct URL + _url = "/routes/path/label/explode/primitive{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +def build_path_parameters_label_expansion_explode_array_request( # pylint: disable=name-too-long + param: List[str], **kwargs: Any +) -> HttpRequest: + # Construct URL + _url = "/routes/path/label/explode/array{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "[str]"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +def build_path_parameters_label_expansion_explode_record_request( # pylint: disable=name-too-long + param: Dict[str, int], **kwargs: Any +) -> HttpRequest: + # Construct URL + _url = "/routes/path/label/explode/record{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "{int}"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +def build_path_parameters_matrix_expansion_standard_primitive_request( # pylint: disable=name-too-long + param: str, **kwargs: Any +) -> HttpRequest: + # Construct URL + _url = "/routes/path/matrix/standard/primitive{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +def build_path_parameters_matrix_expansion_standard_array_request( # pylint: disable=name-too-long + param: List[str], **kwargs: Any +) -> HttpRequest: + # Construct URL + _url = "/routes/path/matrix/standard/array{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "[str]"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +def build_path_parameters_matrix_expansion_standard_record_request( # pylint: disable=name-too-long + param: Dict[str, int], **kwargs: Any +) -> HttpRequest: + # Construct URL + _url = "/routes/path/matrix/standard/record{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "{int}"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +def build_path_parameters_matrix_expansion_explode_primitive_request( # pylint: disable=name-too-long + param: str, **kwargs: Any +) -> HttpRequest: + # Construct URL + _url = "/routes/path/matrix/explode/primitive{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +def build_path_parameters_matrix_expansion_explode_array_request( # pylint: disable=name-too-long + param: List[str], **kwargs: Any +) -> HttpRequest: + # Construct URL + _url = "/routes/path/matrix/explode/array{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "[str]"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +def build_path_parameters_matrix_expansion_explode_record_request( # pylint: disable=name-too-long + param: Dict[str, int], **kwargs: Any +) -> HttpRequest: + # Construct URL + _url = "/routes/path/matrix/explode/record{param}" + path_format_arguments = { + "param": _SERIALIZER.url("param", param, "{int}"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + return HttpRequest(method="GET", url=_url, **kwargs) + + +def build_query_parameters_query_expansion_standard_primitive_request( # pylint: disable=name-too-long + *, param: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + # Construct URL + _url = "/routes/query/query-expansion/standard/primitive" + + # Construct parameters + _params["param"] = _SERIALIZER.query("param", param, "str") + + return HttpRequest(method="GET", url=_url, params=_params, **kwargs) + + +def build_query_parameters_query_expansion_standard_array_request( # pylint: disable=name-too-long + *, param: List[str], **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + # Construct URL + _url = "/routes/query/query-expansion/standard/array" + + # Construct parameters + _params["param"] = [_SERIALIZER.query("param", q, "str") if q is not None else "" for q in param] + + return HttpRequest(method="GET", url=_url, params=_params, **kwargs) + + +def build_query_parameters_query_expansion_standard_record_request( # pylint: disable=name-too-long + *, param: Dict[str, int], **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + # Construct URL + _url = "/routes/query/query-expansion/standard/record" + + # Construct parameters + _params["param"] = _SERIALIZER.query("param", param, "{int}") + + return HttpRequest(method="GET", url=_url, params=_params, **kwargs) + + +def build_query_parameters_query_expansion_explode_primitive_request( # pylint: disable=name-too-long + *, param: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + # Construct URL + _url = "/routes/query/query-expansion/explode/primitive" + + # Construct parameters + _params["param"] = _SERIALIZER.query("param", param, "str") + + return HttpRequest(method="GET", url=_url, params=_params, **kwargs) + + +def build_query_parameters_query_expansion_explode_array_request( # pylint: disable=name-too-long + *, param: List[str], **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + # Construct URL + _url = "/routes/query/query-expansion/explode/array" + + # Construct parameters + _params["param"] = [_SERIALIZER.query("param", q, "str") if q is not None else "" for q in param] + + return HttpRequest(method="GET", url=_url, params=_params, **kwargs) + + +def build_query_parameters_query_expansion_explode_record_request( # pylint: disable=name-too-long + *, param: Dict[str, int], **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + # Construct URL + _url = "/routes/query/query-expansion/explode/record" + + # Construct parameters + _params["param"] = _SERIALIZER.query("param", param, "{int}") + + return HttpRequest(method="GET", url=_url, params=_params, **kwargs) + + +def build_query_parameters_query_continuation_standard_primitive_request( # pylint: disable=name-too-long + *, param: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + # Construct URL + _url = "/routes/query/query-continuation/standard/primitive?fixed=true" + + # Construct parameters + _params["param"] = _SERIALIZER.query("param", param, "str") + + return HttpRequest(method="GET", url=_url, params=_params, **kwargs) + + +def build_query_parameters_query_continuation_standard_array_request( # pylint: disable=name-too-long + *, param: List[str], **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + # Construct URL + _url = "/routes/query/query-continuation/standard/array?fixed=true" + + # Construct parameters + _params["param"] = [_SERIALIZER.query("param", q, "str") if q is not None else "" for q in param] + + return HttpRequest(method="GET", url=_url, params=_params, **kwargs) + + +def build_query_parameters_query_continuation_standard_record_request( # pylint: disable=name-too-long + *, param: Dict[str, int], **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + # Construct URL + _url = "/routes/query/query-continuation/standard/record?fixed=true" + + # Construct parameters + _params["param"] = _SERIALIZER.query("param", param, "{int}") + + return HttpRequest(method="GET", url=_url, params=_params, **kwargs) + + +def build_query_parameters_query_continuation_explode_primitive_request( # pylint: disable=name-too-long + *, param: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + # Construct URL + _url = "/routes/query/query-continuation/explode/primitive?fixed=true" + + # Construct parameters + _params["param"] = _SERIALIZER.query("param", param, "str") + + return HttpRequest(method="GET", url=_url, params=_params, **kwargs) + + +def build_query_parameters_query_continuation_explode_array_request( # pylint: disable=name-too-long + *, param: List[str], **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + # Construct URL + _url = "/routes/query/query-continuation/explode/array?fixed=true" + + # Construct parameters + _params["param"] = [_SERIALIZER.query("param", q, "str") if q is not None else "" for q in param] + + return HttpRequest(method="GET", url=_url, params=_params, **kwargs) + + +def build_query_parameters_query_continuation_explode_record_request( # pylint: disable=name-too-long + *, param: Dict[str, int], **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + # Construct URL + _url = "/routes/query/query-continuation/explode/record?fixed=true" + + # Construct parameters + _params["param"] = _SERIALIZER.query("param", param, "{int}") + + return HttpRequest(method="GET", url=_url, params=_params, **kwargs) + + +class PathParametersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.RoutesClient`'s + :attr:`path_parameters` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + self.reserved_expansion = PathParametersReservedExpansionOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.simple_expansion = PathParametersSimpleExpansionOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.path_expansion = PathParametersPathExpansionOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.label_expansion = PathParametersLabelExpansionOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.matrix_expansion = PathParametersMatrixExpansionOperations( + self._client, self._config, self._serialize, self._deserialize + ) + + def template_only(self, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """template_only. + + :param param: Required. + :type param: str + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_template_only_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + def explicit(self, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """explicit. + + :param param: Required. + :type param: str + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_explicit_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + def annotation_only(self, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """annotation_only. + + :param param: Required. + :type param: str + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_annotation_only_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class QueryParametersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.RoutesClient`'s + :attr:`query_parameters` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + self.query_expansion = QueryParametersQueryExpansionOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.query_continuation = QueryParametersQueryContinuationOperations( + self._client, self._config, self._serialize, self._deserialize + ) + + def template_only(self, *, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """template_only. + + :keyword param: Required. + :paramtype param: str + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_template_only_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + def explicit(self, *, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """explicit. + + :keyword param: Required. + :paramtype param: str + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_explicit_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + def annotation_only(self, *, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """annotation_only. + + :keyword param: Required. + :paramtype param: str + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_annotation_only_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class InInterfaceOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.RoutesClient`'s + :attr:`in_interface` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + def fixed(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """fixed. + + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_in_interface_fixed_request( + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class RoutesClientOperationsMixin(RoutesClientMixinABC): + + def fixed(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """fixed. + + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_routes_fixed_request( + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class PathParametersReservedExpansionOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.RoutesClient`'s + :attr:`reserved_expansion` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + def template(self, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """template. + + :param param: Required. + :type param: str + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_reserved_expansion_template_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + def annotation(self, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """annotation. + + :param param: Required. + :type param: str + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_reserved_expansion_annotation_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class PathParametersSimpleExpansionOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.RoutesClient`'s + :attr:`simple_expansion` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + self.standard = PathParametersSimpleExpansionStandardOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.explode = PathParametersSimpleExpansionExplodeOperations( + self._client, self._config, self._serialize, self._deserialize + ) + + +class PathParametersPathExpansionOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.RoutesClient`'s + :attr:`path_expansion` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + self.standard = PathParametersPathExpansionStandardOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.explode = PathParametersPathExpansionExplodeOperations( + self._client, self._config, self._serialize, self._deserialize + ) + + +class PathParametersLabelExpansionOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.RoutesClient`'s + :attr:`label_expansion` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + self.standard = PathParametersLabelExpansionStandardOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.explode = PathParametersLabelExpansionExplodeOperations( + self._client, self._config, self._serialize, self._deserialize + ) + + +class PathParametersMatrixExpansionOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.RoutesClient`'s + :attr:`matrix_expansion` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + self.standard = PathParametersMatrixExpansionStandardOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.explode = PathParametersMatrixExpansionExplodeOperations( + self._client, self._config, self._serialize, self._deserialize + ) + + +class QueryParametersQueryExpansionOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.RoutesClient`'s + :attr:`query_expansion` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + self.standard = QueryParametersQueryExpansionStandardOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.explode = QueryParametersQueryExpansionExplodeOperations( + self._client, self._config, self._serialize, self._deserialize + ) + + +class QueryParametersQueryContinuationOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.RoutesClient`'s + :attr:`query_continuation` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + self.standard = QueryParametersQueryContinuationStandardOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.explode = QueryParametersQueryContinuationExplodeOperations( + self._client, self._config, self._serialize, self._deserialize + ) + + +class PathParametersSimpleExpansionStandardOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.RoutesClient`'s + :attr:`standard` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + def primitive(self, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """primitive. + + :param param: Required. + :type param: str + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_simple_expansion_standard_primitive_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + def array(self, param: List[str], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """array. + + :param param: Required. + :type param: list[str] + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_simple_expansion_standard_array_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + def record(self, param: Dict[str, int], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """record. + + :param param: Required. + :type param: dict[str, int] + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_simple_expansion_standard_record_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class PathParametersSimpleExpansionExplodeOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.RoutesClient`'s + :attr:`explode` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + def primitive(self, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """primitive. + + :param param: Required. + :type param: str + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_simple_expansion_explode_primitive_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + def array(self, param: List[str], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """array. + + :param param: Required. + :type param: list[str] + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_simple_expansion_explode_array_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + def record(self, param: Dict[str, int], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """record. + + :param param: Required. + :type param: dict[str, int] + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_simple_expansion_explode_record_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class PathParametersPathExpansionStandardOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.RoutesClient`'s + :attr:`standard` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + def primitive(self, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """primitive. + + :param param: Required. + :type param: str + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_path_expansion_standard_primitive_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + def array(self, param: List[str], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """array. + + :param param: Required. + :type param: list[str] + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_path_expansion_standard_array_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + def record(self, param: Dict[str, int], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """record. + + :param param: Required. + :type param: dict[str, int] + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_path_expansion_standard_record_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class PathParametersPathExpansionExplodeOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.RoutesClient`'s + :attr:`explode` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + def primitive(self, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """primitive. + + :param param: Required. + :type param: str + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_path_expansion_explode_primitive_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + def array(self, param: List[str], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """array. + + :param param: Required. + :type param: list[str] + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_path_expansion_explode_array_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + def record(self, param: Dict[str, int], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """record. + + :param param: Required. + :type param: dict[str, int] + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_path_expansion_explode_record_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class PathParametersLabelExpansionStandardOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.RoutesClient`'s + :attr:`standard` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + def primitive(self, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """primitive. + + :param param: Required. + :type param: str + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_label_expansion_standard_primitive_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + def array(self, param: List[str], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """array. + + :param param: Required. + :type param: list[str] + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_label_expansion_standard_array_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + def record(self, param: Dict[str, int], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """record. + + :param param: Required. + :type param: dict[str, int] + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_label_expansion_standard_record_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class PathParametersLabelExpansionExplodeOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.RoutesClient`'s + :attr:`explode` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + def primitive(self, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """primitive. + + :param param: Required. + :type param: str + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_label_expansion_explode_primitive_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + def array(self, param: List[str], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """array. + + :param param: Required. + :type param: list[str] + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_label_expansion_explode_array_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + def record(self, param: Dict[str, int], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """record. + + :param param: Required. + :type param: dict[str, int] + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_label_expansion_explode_record_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class PathParametersMatrixExpansionStandardOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.RoutesClient`'s + :attr:`standard` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + def primitive(self, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """primitive. + + :param param: Required. + :type param: str + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_matrix_expansion_standard_primitive_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + def array(self, param: List[str], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """array. + + :param param: Required. + :type param: list[str] + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_matrix_expansion_standard_array_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + def record(self, param: Dict[str, int], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """record. + + :param param: Required. + :type param: dict[str, int] + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_matrix_expansion_standard_record_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class PathParametersMatrixExpansionExplodeOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.RoutesClient`'s + :attr:`explode` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + def primitive(self, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """primitive. + + :param param: Required. + :type param: str + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_matrix_expansion_explode_primitive_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + def array(self, param: List[str], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """array. + + :param param: Required. + :type param: list[str] + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_matrix_expansion_explode_array_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + def record(self, param: Dict[str, int], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """record. + + :param param: Required. + :type param: dict[str, int] + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_path_parameters_matrix_expansion_explode_record_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class QueryParametersQueryExpansionStandardOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.RoutesClient`'s + :attr:`standard` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + def primitive(self, *, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """primitive. + + :keyword param: Required. + :paramtype param: str + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_query_expansion_standard_primitive_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + def array(self, *, param: List[str], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """array. + + :keyword param: Required. + :paramtype param: list[str] + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_query_expansion_standard_array_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + def record(self, *, param: Dict[str, int], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """record. + + :keyword param: Required. + :paramtype param: dict[str, int] + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_query_expansion_standard_record_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class QueryParametersQueryExpansionExplodeOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.RoutesClient`'s + :attr:`explode` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + def primitive(self, *, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """primitive. + + :keyword param: Required. + :paramtype param: str + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_query_expansion_explode_primitive_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + def array(self, *, param: List[str], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """array. + + :keyword param: Required. + :paramtype param: list[str] + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_query_expansion_explode_array_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + def record(self, *, param: Dict[str, int], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """record. + + :keyword param: Required. + :paramtype param: dict[str, int] + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_query_expansion_explode_record_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class QueryParametersQueryContinuationStandardOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.RoutesClient`'s + :attr:`standard` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + def primitive(self, *, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """primitive. + + :keyword param: Required. + :paramtype param: str + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_query_continuation_standard_primitive_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + def array(self, *, param: List[str], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """array. + + :keyword param: Required. + :paramtype param: list[str] + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_query_continuation_standard_array_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + def record(self, *, param: Dict[str, int], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """record. + + :keyword param: Required. + :paramtype param: dict[str, int] + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_query_continuation_standard_record_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class QueryParametersQueryContinuationExplodeOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~routes.RoutesClient`'s + :attr:`explode` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + def primitive(self, *, param: str, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """primitive. + + :keyword param: Required. + :paramtype param: str + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_query_continuation_explode_primitive_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + def array(self, *, param: List[str], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """array. + + :keyword param: Required. + :paramtype param: list[str] + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_query_continuation_explode_array_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + def record(self, *, param: Dict[str, int], **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """record. + + :keyword param: Required. + :paramtype param: dict[str, int] + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_query_parameters_query_continuation_explode_record_request( + param=param, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/unbranded/generated/routes/routes/operations/_patch.py b/packages/typespec-python/test/unbranded/generated/routes/routes/operations/_patch.py new file mode 100644 index 00000000000..cc9d8be1c50 --- /dev/null +++ b/packages/typespec-python/test/unbranded/generated/routes/routes/operations/_patch.py @@ -0,0 +1,20 @@ +# ------------------------------------ +# Copyright (c) Unbranded Corporation. +# Licensed under the MIT License. +# ------------------------------------ +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" +from typing import List + +__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + + +def patch_sdk(): + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/packages/typespec-python/test/unbranded/generated/routes/routes/py.typed b/packages/typespec-python/test/unbranded/generated/routes/routes/py.typed new file mode 100644 index 00000000000..e5aff4f83af --- /dev/null +++ b/packages/typespec-python/test/unbranded/generated/routes/routes/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/packages/typespec-python/test/unbranded/generated/routes/setup.py b/packages/typespec-python/test/unbranded/generated/routes/setup.py new file mode 100644 index 00000000000..22d8a517c4d --- /dev/null +++ b/packages/typespec-python/test/unbranded/generated/routes/setup.py @@ -0,0 +1,65 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Unbranded Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Unbranded (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# coding: utf-8 + +import os +import re +from setuptools import setup, find_packages + + +PACKAGE_NAME = "routes" +PACKAGE_PPRINT_NAME = "Routes" + +# a-b-c => a/b/c +package_folder_path = PACKAGE_NAME.replace("-", "/") + +# Version extraction inspired from 'requests' +with open(os.path.join(package_folder_path, "_version.py"), "r") as fd: + version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE).group(1) + +if not version: + raise RuntimeError("Cannot find version information") + + +setup( + name=PACKAGE_NAME, + version=version, + description="Unbranded {} Client Library for Python".format(PACKAGE_PPRINT_NAME), + long_description=open("README.md", "r").read(), + long_description_content_type="text/markdown", + license="MIT License", + author="Unbranded Corporation", + classifiers=[ + "Development Status :: 4 - Beta", + "Programming Language :: Python", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "License :: OSI Approved :: MIT License", + ], + zip_safe=False, + packages=find_packages( + exclude=[ + "tests", + ] + ), + include_package_data=True, + package_data={ + "routes": ["py.typed"], + }, + install_requires=[ + "isodate>=0.6.1", + "corehttp[requests]", + "typing-extensions>=4.6.0", + ], + python_requires=">=3.8", +) diff --git a/packages/typespec-python/test/unbranded/generated/special-headers-conditional-request/specialheaders/conditionalrequest/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/special-headers-conditional-request/specialheaders/conditionalrequest/_operations/_operations.py index 7ac657e9b66..aeaec821ff2 100644 --- a/packages/typespec-python/test/unbranded/generated/special-headers-conditional-request/specialheaders/conditionalrequest/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/special-headers-conditional-request/specialheaders/conditionalrequest/_operations/_operations.py @@ -6,6 +6,7 @@ # Code generated by Unbranded (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import datetime import sys from typing import Any, Callable, Dict, Optional, Type, TypeVar @@ -75,6 +76,36 @@ def build_conditional_request_post_if_none_match_request( # pylint: disable=nam return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) +def build_conditional_request_head_if_modified_since_request( # pylint: disable=name-too-long + *, if_modified_since: Optional[datetime.datetime] = None, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + # Construct URL + _url = "/special-headers/conditional-request/if-modified-since" + + # Construct headers + if if_modified_since is not None: + _headers["If-Modified-Since"] = _SERIALIZER.header("if_modified_since", if_modified_since, "rfc-1123") + + return HttpRequest(method="HEAD", url=_url, headers=_headers, **kwargs) + + +def build_conditional_request_post_if_unmodified_since_request( # pylint: disable=name-too-long + *, if_unmodified_since: Optional[datetime.datetime] = None, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + + # Construct URL + _url = "/special-headers/conditional-request/if-unmodified-since" + + # Construct headers + if if_unmodified_since is not None: + _headers["If-Unmodified-Since"] = _SERIALIZER.header("if_unmodified_since", if_unmodified_since, "rfc-1123") + + return HttpRequest(method="POST", url=_url, headers=_headers, **kwargs) + + class ConditionalRequestClientOperationsMixin(ConditionalRequestClientMixinABC): def post_if_match( # pylint: disable=inconsistent-return-statements @@ -192,3 +223,104 @@ def post_if_none_match( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) # type: ignore + + def head_if_modified_since(self, *, if_modified_since: Optional[datetime.datetime] = None, **kwargs: Any) -> bool: + """Check when only If-Modified-Since in header is defined. + + :keyword if_modified_since: A timestamp indicating the last modified time of the resource known + to the + client. The operation will be performed only if the resource on the service has + been modified since the specified time. Default value is None. + :paramtype if_modified_since: ~datetime.datetime + :return: bool + :rtype: bool + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_conditional_request_head_if_modified_since_request( + if_modified_since=if_modified_since, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + return 200 <= response.status_code <= 299 + + def post_if_unmodified_since( # pylint: disable=inconsistent-return-statements + self, *, if_unmodified_since: Optional[datetime.datetime] = None, **kwargs: Any + ) -> None: + """Check when only If-Unmodified-Since in header is defined. + + :keyword if_unmodified_since: A timestamp indicating the last modified time of the resource + known to the + client. The operation will be performed only if the resource on the service has + not been modified since the specified time. Default value is None. + :paramtype if_unmodified_since: ~datetime.datetime + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_conditional_request_post_if_unmodified_since_request( + if_unmodified_since=if_unmodified_since, + 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 = 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 [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/packages/typespec-python/test/unbranded/generated/special-headers-conditional-request/specialheaders/conditionalrequest/aio/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/special-headers-conditional-request/specialheaders/conditionalrequest/aio/_operations/_operations.py index dac293487f7..c8db372f4c9 100644 --- a/packages/typespec-python/test/unbranded/generated/special-headers-conditional-request/specialheaders/conditionalrequest/aio/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/special-headers-conditional-request/specialheaders/conditionalrequest/aio/_operations/_operations.py @@ -6,6 +6,7 @@ # Code generated by Unbranded (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import datetime import sys from typing import Any, Callable, Dict, Optional, Type, TypeVar @@ -23,8 +24,10 @@ from corehttp.runtime.pipeline import PipelineResponse from ..._operations._operations import ( + build_conditional_request_head_if_modified_since_request, build_conditional_request_post_if_match_request, build_conditional_request_post_if_none_match_request, + build_conditional_request_post_if_unmodified_since_request, ) from .._vendor import ConditionalRequestClientMixinABC @@ -153,3 +156,106 @@ async def post_if_none_match( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) # type: ignore + + async def head_if_modified_since( + self, *, if_modified_since: Optional[datetime.datetime] = None, **kwargs: Any + ) -> bool: + """Check when only If-Modified-Since in header is defined. + + :keyword if_modified_since: A timestamp indicating the last modified time of the resource known + to the + client. The operation will be performed only if the resource on the service has + been modified since the specified time. Default value is None. + :paramtype if_modified_since: ~datetime.datetime + :return: bool + :rtype: bool + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_conditional_request_head_if_modified_since_request( + if_modified_since=if_modified_since, + 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 = False + pipeline_response: PipelineResponse = await self._client.pipeline.run( # type: ignore # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + return 200 <= response.status_code <= 299 + + async def post_if_unmodified_since( # pylint: disable=inconsistent-return-statements + self, *, if_unmodified_since: Optional[datetime.datetime] = None, **kwargs: Any + ) -> None: + """Check when only If-Unmodified-Since in header is defined. + + :keyword if_unmodified_since: A timestamp indicating the last modified time of the resource + known to the + client. The operation will be performed only if the resource on the service has + not been modified since the specified time. Default value is None. + :paramtype if_unmodified_since: ~datetime.datetime + :return: None + :rtype: None + :raises ~corehttp.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_conditional_request_post_if_unmodified_since_request( + if_unmodified_since=if_unmodified_since, + 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 = False + pipeline_response: PipelineResponse = await self._client.pipeline.run( # type: ignore # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1f649abca3a..7acbbfce988 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -12,8 +12,8 @@ importers: specifier: 6.0.0 version: 6.0.0 '@azure-tools/cadl-ranch': - specifier: ~0.14.2 - version: 0.14.2(@typespec/versioning@0.59.0(@typespec/compiler@0.59.0)) + specifier: ~0.14.5 + version: 0.14.5(@typespec/versioning@0.59.0(@typespec/compiler@0.59.1)) '@chronus/chronus': specifier: ^0.10.2 version: 0.10.2 @@ -89,11 +89,11 @@ importers: version: 4.17.0 devDependencies: '@azure-tools/cadl-ranch-expect': - specifier: ~0.15.1 - version: 0.15.1(@typespec/compiler@0.59.1)(@typespec/http@0.59.0(@typespec/compiler@0.59.1))(@typespec/rest@0.59.0(@typespec/compiler@0.59.1)(@typespec/http@0.59.0(@typespec/compiler@0.59.1)))(@typespec/versioning@0.59.0(@typespec/compiler@0.59.1)) + specifier: ~0.15.3 + version: 0.15.3(@typespec/compiler@0.59.1)(@typespec/http@0.59.0(@typespec/compiler@0.59.1))(@typespec/rest@0.59.0(@typespec/compiler@0.59.1)(@typespec/http@0.59.0(@typespec/compiler@0.59.1)))(@typespec/versioning@0.59.0(@typespec/compiler@0.59.1)) '@azure-tools/cadl-ranch-specs': - specifier: ~0.36.1 - version: 0.36.1(@azure-tools/cadl-ranch-expect@0.15.1(@typespec/compiler@0.59.1)(@typespec/http@0.59.0(@typespec/compiler@0.59.1))(@typespec/rest@0.59.0(@typespec/compiler@0.59.1)(@typespec/http@0.59.0(@typespec/compiler@0.59.1)))(@typespec/versioning@0.59.0(@typespec/compiler@0.59.1)))(@azure-tools/typespec-azure-core@0.45.0(@typespec/compiler@0.59.1)(@typespec/http@0.59.0(@typespec/compiler@0.59.1))(@typespec/rest@0.59.0(@typespec/compiler@0.59.1)(@typespec/http@0.59.0(@typespec/compiler@0.59.1))))(@typespec/compiler@0.59.1)(@typespec/http@0.59.0(@typespec/compiler@0.59.1))(@typespec/rest@0.59.0(@typespec/compiler@0.59.1)(@typespec/http@0.59.0(@typespec/compiler@0.59.1)))(@typespec/versioning@0.59.0(@typespec/compiler@0.59.1))(@typespec/xml@0.59.0(@typespec/compiler@0.59.1)) + specifier: ~0.37.1 + version: 0.37.1(@azure-tools/cadl-ranch-expect@0.15.3(@typespec/compiler@0.59.1)(@typespec/http@0.59.0(@typespec/compiler@0.59.1))(@typespec/rest@0.59.0(@typespec/compiler@0.59.1)(@typespec/http@0.59.0(@typespec/compiler@0.59.1)))(@typespec/versioning@0.59.0(@typespec/compiler@0.59.1)))(@azure-tools/typespec-azure-core@0.45.0(@typespec/compiler@0.59.1)(@typespec/http@0.59.0(@typespec/compiler@0.59.1))(@typespec/rest@0.59.0(@typespec/compiler@0.59.1)(@typespec/http@0.59.0(@typespec/compiler@0.59.1))))(@typespec/compiler@0.59.1)(@typespec/http@0.59.0(@typespec/compiler@0.59.1))(@typespec/rest@0.59.0(@typespec/compiler@0.59.1)(@typespec/http@0.59.0(@typespec/compiler@0.59.1)))(@typespec/versioning@0.59.0(@typespec/compiler@0.59.1))(@typespec/xml@0.59.0(@typespec/compiler@0.59.1)) '@azure-tools/typespec-autorest': specifier: ~0.45.0 version: 0.45.0(c3fu7d6orpkmpid6d4ilf3pty4) @@ -181,20 +181,16 @@ packages: resolution: {integrity: sha512-T21naRb6JDdjjn2s/zwr9iCIv/9jviL/PRtiWAhi+3UA2WKH2wrId2VqJa4uVD7iEV8BLkuGgFmMkaMBG26hFw==} engines: {node: '>=12.0.0'} - '@azure-tools/cadl-ranch-api@0.4.5': - resolution: {integrity: sha512-OXJ65ibuli0q7gsWo/5lv8BznSv4thpBxL5qERUyd1w6tvOOCg5iBBidZMUbmlasYspLCP25YlKqiOgbdPhHDQ==} - engines: {node: '>=16.0.0'} - '@azure-tools/cadl-ranch-api@0.4.6': resolution: {integrity: sha512-IwIpl+wZYXWdDuY3hoI81n7rkm90CcjMWxQLhUYjBhppvc4o1YYgkV9jfxMBaclrDgS1R2TrAq2Xul/+kY99lg==} engines: {node: '>=16.0.0'} - '@azure-tools/cadl-ranch-coverage-sdk@0.8.3': - resolution: {integrity: sha512-tYgSawBWKRMwaA8sW4CuVynMlxnxmwjH0pG3qkHDuX8oIxvi/yawrLimLDNV29zAQiESHJkFU7THh/qG51oYPQ==} + '@azure-tools/cadl-ranch-coverage-sdk@0.8.4': + resolution: {integrity: sha512-N207EZEdJrXDKUVmi5Cnw/4y+/Ou9dTbdhMPDoLaalUxZp8T/YK+Y057/M88G0dY76PEAwWPPDolLchW62LZNQ==} engines: {node: '>=16.0.0'} - '@azure-tools/cadl-ranch-expect@0.15.1': - resolution: {integrity: sha512-gVu077Rtry3YM0JvsMocXi2KMQPUBaMSF7BKiIKzsxIB/YKAYKe+WEAMfkbFs3BQrbbYMMEWSMQQVUFzfaWpog==} + '@azure-tools/cadl-ranch-expect@0.15.3': + resolution: {integrity: sha512-ulUf2aN9UznF71NMwqVjcvEOw3F5BlL1HqeTwHZl3ZgRs8x2+HRLE+lwIEjfQi6h1ISn9u3kr+wslB03uOaoIQ==} engines: {node: '>=16.0.0'} peerDependencies: '@typespec/compiler': ~0.59.0 @@ -202,11 +198,11 @@ packages: '@typespec/rest': ~0.59.0 '@typespec/versioning': ~0.59.0 - '@azure-tools/cadl-ranch-specs@0.36.1': - resolution: {integrity: sha512-DmgSaMeEhM6N3ZTFCDcBAy73hz8o1PYUdAKCN9P6WCj8sOVzZ8FCD9CGi2XjKBMqeJr4KHHooIgceglODJWSwQ==} + '@azure-tools/cadl-ranch-specs@0.37.1': + resolution: {integrity: sha512-XR8UxsbTQTSYbgyObcytRP0PLNWrU6cA8dTwQYh+VA/92HrSQYaJ8cQZZ/EyIFjFuSEVGQ74Rx6hpGvfKUrh2w==} engines: {node: '>=16.0.0'} peerDependencies: - '@azure-tools/cadl-ranch-expect': ~0.15.1 + '@azure-tools/cadl-ranch-expect': ~0.15.3 '@azure-tools/typespec-azure-core': ~0.45.0 '@typespec/compiler': ~0.59.0 '@typespec/http': ~0.59.0 @@ -214,13 +210,8 @@ packages: '@typespec/versioning': ~0.59.0 '@typespec/xml': ~0.59.0 - '@azure-tools/cadl-ranch@0.14.2': - resolution: {integrity: sha512-5aMzmiCbMXijc9c3TVCxYdoF4ALyu5fGZhv4gGSSHYCNvqc2uE10seURu5jIVp0GZWyKv9Bis152rYKw/gg01g==} - engines: {node: '>=16.0.0'} - hasBin: true - - '@azure-tools/cadl-ranch@0.14.3': - resolution: {integrity: sha512-7UVhTi5dHR9hH6OnpWQONvDJGx5t5sU9q8BYHoJU0gdaTy0x23EHie5GTMg7aIFI896kuksu4iggUnQaCm2AnA==} + '@azure-tools/cadl-ranch@0.14.5': + resolution: {integrity: sha512-vF98b9ru49YvzcFnuSW6A/gpDOSZcTd/0S42XnmTyTVuF+fp3XOatXTvoUlKnQ25du8hZTm7JFzcZeOova7Xbw==} engines: {node: '>=16.0.0'} hasBin: true @@ -324,10 +315,6 @@ packages: resolution: {integrity: sha512-KxDlhXyMlh2Jhj2ykX6vNEU0Vou4nHr025KoSEiz7cS3BNiHNaZcdECk/DmLkEB0as5T7b/TpRcehJ5yV6NeXQ==} engines: {node: '>=12.0.0'} - '@azure/core-tracing@1.1.1': - resolution: {integrity: sha512-qPbYhN1pE5XQ2jPKIHP33x8l3oBu1UqIWnYqZZ3OYnYjzY0xqIHjn49C+ptsPD9yC7uyWI9Zm7iZUZLs2R4DhQ==} - engines: {node: '>=18.0.0'} - '@azure/core-tracing@1.1.2': resolution: {integrity: sha512-dawW9ifvWAWmUm9/h+/UQ2jrdvjCJ7VJEuCJ6XVNudzcOwm53BFZH4Q845vjfgoUAM8ZxokvVNxNxAITc502YA==} engines: {node: '>=18.0.0'} @@ -1261,11 +1248,6 @@ packages: resolution: {integrity: sha512-nxn+dozQx+MK61nn/JP+M4eCkHDSxSLDpgE3WcQo0+fkjEolnaB5jswvIKC4K56By8MMgIho7f1PVxERHEo8rw==} engines: {node: ^18.18.0 || >=20.0.0} - '@typespec/compiler@0.59.0': - resolution: {integrity: sha512-fqh2TeAWQyt70f7NkfwOvoQMqHAfGzIfvcUi+XW55+ms6opiqNXBIT822Jr+T4fNo1PgsnbKC34n6SSIMxnOqw==} - engines: {node: '>=18.0.0'} - hasBin: true - '@typespec/compiler@0.59.1': resolution: {integrity: sha512-O2ljgr6YoFaIH6a8lWc90/czdv4B2X6N9wz4WsnQnVvgO0Tj0s+3xkvp4Tv59RKMhT0f3fK6dL8oEGO32FYk1A==} engines: {node: '>=18.0.0'} @@ -4124,24 +4106,6 @@ snapshots: command-exists: 1.2.9 semver: 7.6.2 - '@azure-tools/cadl-ranch-api@0.4.5': - dependencies: - body-parser: 1.20.2 - deep-equal: 2.2.3 - express: 4.19.2 - express-promise-router: 4.1.1(express@4.19.2) - glob: 11.0.0 - morgan: 1.10.0 - multer: 1.4.5-lts.1 - picocolors: 1.0.1 - winston: 3.14.1 - xml-formatter: 3.6.3 - xml2js: 0.6.2 - yargs: 17.7.2 - transitivePeerDependencies: - - '@types/express' - - supports-color - '@azure-tools/cadl-ranch-api@0.4.6': dependencies: body-parser: 1.20.2 @@ -4160,7 +4124,7 @@ snapshots: - '@types/express' - supports-color - '@azure-tools/cadl-ranch-coverage-sdk@0.8.3': + '@azure-tools/cadl-ranch-coverage-sdk@0.8.4': dependencies: '@azure/identity': 4.4.1 '@azure/storage-blob': 12.24.0 @@ -4168,25 +4132,18 @@ snapshots: transitivePeerDependencies: - supports-color - '@azure-tools/cadl-ranch-expect@0.15.1(@typespec/compiler@0.59.0)(@typespec/http@0.59.0(@typespec/compiler@0.59.0))(@typespec/rest@0.59.0(@typespec/compiler@0.59.0)(@typespec/http@0.59.0(@typespec/compiler@0.59.0)))(@typespec/versioning@0.59.0(@typespec/compiler@0.59.0))': - dependencies: - '@typespec/compiler': 0.59.0 - '@typespec/http': 0.59.0(@typespec/compiler@0.59.0) - '@typespec/rest': 0.59.0(@typespec/compiler@0.59.0)(@typespec/http@0.59.0(@typespec/compiler@0.59.0)) - '@typespec/versioning': 0.59.0(@typespec/compiler@0.59.0) - - '@azure-tools/cadl-ranch-expect@0.15.1(@typespec/compiler@0.59.1)(@typespec/http@0.59.0(@typespec/compiler@0.59.1))(@typespec/rest@0.59.0(@typespec/compiler@0.59.1)(@typespec/http@0.59.0(@typespec/compiler@0.59.1)))(@typespec/versioning@0.59.0(@typespec/compiler@0.59.1))': + '@azure-tools/cadl-ranch-expect@0.15.3(@typespec/compiler@0.59.1)(@typespec/http@0.59.0(@typespec/compiler@0.59.1))(@typespec/rest@0.59.0(@typespec/compiler@0.59.1)(@typespec/http@0.59.0(@typespec/compiler@0.59.1)))(@typespec/versioning@0.59.0(@typespec/compiler@0.59.1))': dependencies: '@typespec/compiler': 0.59.1 '@typespec/http': 0.59.0(@typespec/compiler@0.59.1) '@typespec/rest': 0.59.0(@typespec/compiler@0.59.1)(@typespec/http@0.59.0(@typespec/compiler@0.59.1)) '@typespec/versioning': 0.59.0(@typespec/compiler@0.59.1) - '@azure-tools/cadl-ranch-specs@0.36.1(@azure-tools/cadl-ranch-expect@0.15.1(@typespec/compiler@0.59.1)(@typespec/http@0.59.0(@typespec/compiler@0.59.1))(@typespec/rest@0.59.0(@typespec/compiler@0.59.1)(@typespec/http@0.59.0(@typespec/compiler@0.59.1)))(@typespec/versioning@0.59.0(@typespec/compiler@0.59.1)))(@azure-tools/typespec-azure-core@0.45.0(@typespec/compiler@0.59.1)(@typespec/http@0.59.0(@typespec/compiler@0.59.1))(@typespec/rest@0.59.0(@typespec/compiler@0.59.1)(@typespec/http@0.59.0(@typespec/compiler@0.59.1))))(@typespec/compiler@0.59.1)(@typespec/http@0.59.0(@typespec/compiler@0.59.1))(@typespec/rest@0.59.0(@typespec/compiler@0.59.1)(@typespec/http@0.59.0(@typespec/compiler@0.59.1)))(@typespec/versioning@0.59.0(@typespec/compiler@0.59.1))(@typespec/xml@0.59.0(@typespec/compiler@0.59.1))': + '@azure-tools/cadl-ranch-specs@0.37.1(@azure-tools/cadl-ranch-expect@0.15.3(@typespec/compiler@0.59.1)(@typespec/http@0.59.0(@typespec/compiler@0.59.1))(@typespec/rest@0.59.0(@typespec/compiler@0.59.1)(@typespec/http@0.59.0(@typespec/compiler@0.59.1)))(@typespec/versioning@0.59.0(@typespec/compiler@0.59.1)))(@azure-tools/typespec-azure-core@0.45.0(@typespec/compiler@0.59.1)(@typespec/http@0.59.0(@typespec/compiler@0.59.1))(@typespec/rest@0.59.0(@typespec/compiler@0.59.1)(@typespec/http@0.59.0(@typespec/compiler@0.59.1))))(@typespec/compiler@0.59.1)(@typespec/http@0.59.0(@typespec/compiler@0.59.1))(@typespec/rest@0.59.0(@typespec/compiler@0.59.1)(@typespec/http@0.59.0(@typespec/compiler@0.59.1)))(@typespec/versioning@0.59.0(@typespec/compiler@0.59.1))(@typespec/xml@0.59.0(@typespec/compiler@0.59.1))': dependencies: - '@azure-tools/cadl-ranch': 0.14.3(@typespec/versioning@0.59.0(@typespec/compiler@0.59.1)) + '@azure-tools/cadl-ranch': 0.14.5(@typespec/versioning@0.59.0(@typespec/compiler@0.59.1)) '@azure-tools/cadl-ranch-api': 0.4.6 - '@azure-tools/cadl-ranch-expect': 0.15.1(@typespec/compiler@0.59.1)(@typespec/http@0.59.0(@typespec/compiler@0.59.1))(@typespec/rest@0.59.0(@typespec/compiler@0.59.1)(@typespec/http@0.59.0(@typespec/compiler@0.59.1)))(@typespec/versioning@0.59.0(@typespec/compiler@0.59.1)) + '@azure-tools/cadl-ranch-expect': 0.15.3(@typespec/compiler@0.59.1)(@typespec/http@0.59.0(@typespec/compiler@0.59.1))(@typespec/rest@0.59.0(@typespec/compiler@0.59.1)(@typespec/http@0.59.0(@typespec/compiler@0.59.1)))(@typespec/versioning@0.59.0(@typespec/compiler@0.59.1)) '@azure-tools/typespec-azure-core': 0.45.0(@typespec/compiler@0.59.1)(@typespec/http@0.59.0(@typespec/compiler@0.59.1))(@typespec/rest@0.59.0(@typespec/compiler@0.59.1)(@typespec/http@0.59.0(@typespec/compiler@0.59.1))) '@typespec/compiler': 0.59.1 '@typespec/http': 0.59.0(@typespec/compiler@0.59.1) @@ -4197,42 +4154,11 @@ snapshots: - '@types/express' - supports-color - '@azure-tools/cadl-ranch@0.14.2(@typespec/versioning@0.59.0(@typespec/compiler@0.59.0))': - dependencies: - '@azure-tools/cadl-ranch-api': 0.4.5 - '@azure-tools/cadl-ranch-coverage-sdk': 0.8.3 - '@azure-tools/cadl-ranch-expect': 0.15.1(@typespec/compiler@0.59.0)(@typespec/http@0.59.0(@typespec/compiler@0.59.0))(@typespec/rest@0.59.0(@typespec/compiler@0.59.0)(@typespec/http@0.59.0(@typespec/compiler@0.59.0)))(@typespec/versioning@0.59.0(@typespec/compiler@0.59.0)) - '@azure/identity': 4.4.1 - '@types/js-yaml': 4.0.9 - '@typespec/compiler': 0.59.0 - '@typespec/http': 0.59.0(@typespec/compiler@0.59.0) - '@typespec/rest': 0.59.0(@typespec/compiler@0.59.0)(@typespec/http@0.59.0(@typespec/compiler@0.59.0)) - ajv: 8.17.1 - body-parser: 1.20.2 - deep-equal: 2.2.3 - express: 4.19.2 - express-promise-router: 4.1.1(express@4.19.2) - glob: 11.0.0 - jackspeak: 4.0.1 - js-yaml: 4.1.0 - morgan: 1.10.0 - multer: 1.4.5-lts.1 - node-fetch: 3.3.2 - picocolors: 1.0.1 - source-map-support: 0.5.21 - winston: 3.14.1 - xml2js: 0.6.2 - yargs: 17.7.2 - transitivePeerDependencies: - - '@types/express' - - '@typespec/versioning' - - supports-color - - '@azure-tools/cadl-ranch@0.14.3(@typespec/versioning@0.59.0(@typespec/compiler@0.59.1))': + '@azure-tools/cadl-ranch@0.14.5(@typespec/versioning@0.59.0(@typespec/compiler@0.59.1))': dependencies: '@azure-tools/cadl-ranch-api': 0.4.6 - '@azure-tools/cadl-ranch-coverage-sdk': 0.8.3 - '@azure-tools/cadl-ranch-expect': 0.15.1(@typespec/compiler@0.59.1)(@typespec/http@0.59.0(@typespec/compiler@0.59.1))(@typespec/rest@0.59.0(@typespec/compiler@0.59.1)(@typespec/http@0.59.0(@typespec/compiler@0.59.1)))(@typespec/versioning@0.59.0(@typespec/compiler@0.59.1)) + '@azure-tools/cadl-ranch-coverage-sdk': 0.8.4 + '@azure-tools/cadl-ranch-expect': 0.15.3(@typespec/compiler@0.59.1)(@typespec/http@0.59.0(@typespec/compiler@0.59.1))(@typespec/rest@0.59.0(@typespec/compiler@0.59.1)(@typespec/http@0.59.0(@typespec/compiler@0.59.1)))(@typespec/versioning@0.59.0(@typespec/compiler@0.59.1)) '@azure/identity': 4.4.1 '@types/js-yaml': 4.0.9 '@typespec/compiler': 0.59.1 @@ -4324,7 +4250,7 @@ snapshots: '@azure/abort-controller': 2.1.1 '@azure/core-auth': 1.7.1 '@azure/core-rest-pipeline': 1.15.1 - '@azure/core-tracing': 1.1.1 + '@azure/core-tracing': 1.1.2 '@azure/core-util': 1.8.1 '@azure/logger': 1.1.1 tslib: 2.6.2 @@ -4384,7 +4310,7 @@ snapshots: dependencies: '@azure/abort-controller': 2.1.1 '@azure/core-auth': 1.7.1 - '@azure/core-tracing': 1.1.1 + '@azure/core-tracing': 1.1.2 '@azure/core-util': 1.8.1 '@azure/logger': 1.1.1 http-proxy-agent: 7.0.2 @@ -4398,10 +4324,6 @@ snapshots: '@opentelemetry/api': 1.4.1 tslib: 2.6.2 - '@azure/core-tracing@1.1.1': - dependencies: - tslib: 2.6.2 - '@azure/core-tracing@1.1.2': dependencies: tslib: 2.6.2 @@ -4422,7 +4344,7 @@ snapshots: '@azure/core-auth': 1.7.1 '@azure/core-client': 1.9.2 '@azure/core-rest-pipeline': 1.15.1 - '@azure/core-tracing': 1.1.1 + '@azure/core-tracing': 1.1.2 '@azure/core-util': 1.8.1 '@azure/logger': 1.1.1 '@azure/msal-browser': 3.20.0 @@ -5265,7 +5187,7 @@ snapshots: dependencies: '@types/yargs-parser': 21.0.3 - '@typescript-eslint/eslint-plugin@7.13.0(@typescript-eslint/parser@7.13.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0)(typescript@5.4.5)': + '@typescript-eslint/eslint-plugin@7.13.0(@typescript-eslint/parser@7.13.0(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0)(typescript@5.4.5)': dependencies: '@eslint-community/regexpp': 4.10.0 '@typescript-eslint/parser': 7.13.0(eslint@8.57.0)(typescript@5.4.5) @@ -5310,7 +5232,7 @@ snapshots: dependencies: '@typescript-eslint/typescript-estree': 7.13.0(typescript@5.4.5) '@typescript-eslint/utils': 7.13.0(eslint@8.57.0)(typescript@5.4.5) - debug: 4.3.4 + debug: 4.3.6 eslint: 8.57.0 ts-api-utils: 1.3.0(typescript@5.4.5) optionalDependencies: @@ -5326,7 +5248,7 @@ snapshots: dependencies: '@typescript-eslint/types': 6.21.0 '@typescript-eslint/visitor-keys': 6.21.0 - debug: 4.3.4 + debug: 4.3.6 globby: 11.1.0 is-glob: 4.0.3 minimatch: 9.0.3 @@ -5341,7 +5263,7 @@ snapshots: dependencies: '@typescript-eslint/types': 7.13.0 '@typescript-eslint/visitor-keys': 7.13.0 - debug: 4.3.4 + debug: 4.3.6 globby: 11.1.0 is-glob: 4.0.3 minimatch: 9.0.4 @@ -5387,23 +5309,6 @@ snapshots: '@typescript-eslint/types': 7.13.0 eslint-visitor-keys: 3.4.3 - '@typespec/compiler@0.59.0': - dependencies: - '@babel/code-frame': 7.24.7 - ajv: 8.17.1 - change-case: 5.4.4 - globby: 14.0.2 - mustache: 4.2.0 - picocolors: 1.0.1 - prettier: 3.3.3 - prompts: 2.4.2 - semver: 7.6.3 - temporal-polyfill: 0.2.5 - vscode-languageserver: 9.0.1 - vscode-languageserver-textdocument: 1.0.11 - yaml: 2.4.5 - yargs: 17.7.2 - '@typespec/compiler@0.59.1': dependencies: '@babel/code-frame': 7.24.7 @@ -5424,14 +5329,14 @@ snapshots: '@typespec/eslint-config-typespec@0.55.0(prettier@3.3.3)(vitest@2.0.5(@types/node@18.16.3))': dependencies: '@rushstack/eslint-patch': 1.10.1 - '@typescript-eslint/eslint-plugin': 7.13.0(@typescript-eslint/parser@7.13.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0)(typescript@5.4.5) + '@typescript-eslint/eslint-plugin': 7.13.0(@typescript-eslint/parser@7.13.0(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0)(typescript@5.4.5) '@typescript-eslint/parser': 7.13.0(eslint@8.57.0)(typescript@5.4.5) eslint: 8.57.0 eslint-config-prettier: 9.1.0(eslint@8.57.0) eslint-plugin-deprecation: 2.0.0(eslint@8.57.0)(typescript@5.4.5) eslint-plugin-prettier: 5.1.3(eslint-config-prettier@9.1.0(eslint@8.57.0))(eslint@8.57.0)(prettier@3.3.3) eslint-plugin-unicorn: 51.0.1(eslint@8.57.0) - eslint-plugin-vitest: 0.4.1(@typescript-eslint/eslint-plugin@7.13.0(@typescript-eslint/parser@7.13.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0)(typescript@5.4.5)(vitest@2.0.5(@types/node@18.16.3)) + eslint-plugin-vitest: 0.4.1(@typescript-eslint/eslint-plugin@7.13.0(@typescript-eslint/parser@7.13.0(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0)(typescript@5.4.5)(vitest@2.0.5(@types/node@18.16.3)) typescript: 5.4.5 transitivePeerDependencies: - '@types/eslint' @@ -5439,10 +5344,6 @@ snapshots: - supports-color - vitest - '@typespec/http@0.59.0(@typespec/compiler@0.59.0)': - dependencies: - '@typespec/compiler': 0.59.0 - '@typespec/http@0.59.0(@typespec/compiler@0.59.1)': dependencies: '@typespec/compiler': 0.59.1 @@ -5467,20 +5368,11 @@ snapshots: dependencies: prettier: 3.3.3 - '@typespec/rest@0.59.0(@typespec/compiler@0.59.0)(@typespec/http@0.59.0(@typespec/compiler@0.59.0))': - dependencies: - '@typespec/compiler': 0.59.0 - '@typespec/http': 0.59.0(@typespec/compiler@0.59.0) - '@typespec/rest@0.59.0(@typespec/compiler@0.59.1)(@typespec/http@0.59.0(@typespec/compiler@0.59.1))': dependencies: '@typespec/compiler': 0.59.1 '@typespec/http': 0.59.0(@typespec/compiler@0.59.1) - '@typespec/versioning@0.59.0(@typespec/compiler@0.59.0)': - dependencies: - '@typespec/compiler': 0.59.0 - '@typespec/versioning@0.59.0(@typespec/compiler@0.59.1)': dependencies: '@typespec/compiler': 0.59.1 @@ -5539,7 +5431,7 @@ snapshots: agent-base@7.1.1: dependencies: - debug: 4.3.4 + debug: 4.3.6 transitivePeerDependencies: - supports-color @@ -6350,12 +6242,12 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-plugin-vitest@0.4.1(@typescript-eslint/eslint-plugin@7.13.0(@typescript-eslint/parser@7.13.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0)(typescript@5.4.5)(vitest@2.0.5(@types/node@18.16.3)): + eslint-plugin-vitest@0.4.1(@typescript-eslint/eslint-plugin@7.13.0(@typescript-eslint/parser@7.13.0(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0)(typescript@5.4.5)(vitest@2.0.5(@types/node@18.16.3)): dependencies: '@typescript-eslint/utils': 7.13.0(eslint@8.57.0)(typescript@5.4.5) eslint: 8.57.0 optionalDependencies: - '@typescript-eslint/eslint-plugin': 7.13.0(@typescript-eslint/parser@7.13.0(eslint@8.57.0)(typescript@5.4.5))(eslint@8.57.0)(typescript@5.4.5) + '@typescript-eslint/eslint-plugin': 7.13.0(@typescript-eslint/parser@7.13.0(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0)(typescript@5.4.5) vitest: 2.0.5(@types/node@18.16.3) transitivePeerDependencies: - supports-color @@ -6852,7 +6744,7 @@ snapshots: http-proxy-agent@7.0.2: dependencies: agent-base: 7.1.1 - debug: 4.3.4 + debug: 4.3.6 transitivePeerDependencies: - supports-color @@ -6865,7 +6757,7 @@ snapshots: https-proxy-agent@7.0.4: dependencies: agent-base: 7.1.1 - debug: 4.3.4 + debug: 4.3.6 transitivePeerDependencies: - supports-color @@ -7228,7 +7120,7 @@ snapshots: cacache: 18.0.2 http-cache-semantics: 4.1.1 is-lambda: 1.0.1 - minipass: 7.0.4 + minipass: 7.1.2 minipass-fetch: 3.0.4 minipass-flush: 1.0.5 minipass-pipeline: 1.2.4 @@ -7295,11 +7187,11 @@ snapshots: minipass-collect@2.0.1: dependencies: - minipass: 7.0.4 + minipass: 7.1.2 minipass-fetch@3.0.4: dependencies: - minipass: 7.0.4 + minipass: 7.1.2 minipass-sized: 1.0.3 minizlib: 2.1.2 optionalDependencies: @@ -7458,7 +7350,7 @@ snapshots: dependencies: '@npmcli/redact': 1.1.0 make-fetch-happen: 13.0.0 - minipass: 7.0.4 + minipass: 7.1.2 minipass-fetch: 3.0.4 minipass-json-stream: 1.0.1 minizlib: 2.1.2 @@ -7672,7 +7564,7 @@ snapshots: path-scurry@1.10.2: dependencies: lru-cache: 10.2.0 - minipass: 7.0.4 + minipass: 7.1.2 path-scurry@2.0.0: dependencies: @@ -8055,7 +7947,7 @@ snapshots: socks-proxy-agent@8.0.3: dependencies: agent-base: 7.1.1 - debug: 4.3.4 + debug: 4.3.6 socks: 2.8.3 transitivePeerDependencies: - supports-color @@ -8295,7 +8187,7 @@ snapshots: tuf-js@2.2.0: dependencies: '@tufjs/models': 2.0.0 - debug: 4.3.4 + debug: 4.3.6 make-fetch-happen: 13.0.0 transitivePeerDependencies: - supports-color