From 5b15e35b257a778bebe664639f7c7ff960faad3f Mon Sep 17 00:00:00 2001 From: AutoPrFromHttpClientPython Date: Mon, 31 Mar 2025 09:22:20 +0000 Subject: [PATCH 01/19] Update dependencies (2025-03-31 09:22:20) --- packages/autorest.python/package.json | 4 +- packages/typespec-python/package.json | 60 +- pnpm-lock.yaml | 1339 +++++++++++++------------ 3 files changed, 753 insertions(+), 650 deletions(-) diff --git a/packages/autorest.python/package.json b/packages/autorest.python/package.json index ddd137461cb..9bae9b6d283 100644 --- a/packages/autorest.python/package.json +++ b/packages/autorest.python/package.json @@ -29,7 +29,7 @@ }, "homepage": "https://github.com/Azure/autorest.python/blob/main/README.md", "dependencies": { - "@typespec/http-client-python": "~0.8.3-dev.2", + "@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcwNTAzNi9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.2.tgz", "@autorest/system-requirements": "~1.0.2", "fs-extra": "~11.2.0", "tsx": "~4.19.1" @@ -47,4 +47,4 @@ "requirements.txt", "generator/" ] -} +} \ No newline at end of file diff --git a/packages/typespec-python/package.json b/packages/typespec-python/package.json index aa9c8e3cb68..557a369998f 100644 --- a/packages/typespec-python/package.json +++ b/packages/typespec-python/package.json @@ -45,43 +45,43 @@ "generator/**" ], "peerDependencies": { - "@typespec/compiler": ">=0.67.0 <1.0.0", - "@typespec/http": ">=0.67.0 <1.0.0", - "@typespec/rest": ">=0.67.0 <1.0.0", - "@typespec/versioning": ">=0.67.0 <1.0.0", - "@typespec/openapi": ">=0.67.0 <1.0.0", - "@typespec/events": ">=0.67.0 <1.0.0", - "@typespec/sse": ">=0.67.0 <1.0.0", - "@typespec/streams": ">=0.67.0 <1.0.0", - "@azure-tools/typespec-azure-core": ">=0.53.0 <1.0.0", - "@azure-tools/typespec-azure-resource-manager": ">=0.53.0 <1.0.0", - "@azure-tools/typespec-autorest": ">=0.53.0 <1.0.0", - "@azure-tools/typespec-azure-rulesets": ">=0.53.0 <3.0.0", - "@azure-tools/typespec-client-generator-core": ">=0.53.1 <1.0.0" + "@typespec/compiler": ">=0.68.0-dev.11 <1.0.0", + "@typespec/http": ">=0.68.0-dev.8 <1.0.0", + "@typespec/rest": ">=0.68.0-dev.3 <1.0.0", + "@typespec/versioning": ">=0.68.0-dev.2 <1.0.0", + "@typespec/openapi": ">=0.68.0-dev.3 <1.0.0", + "@typespec/events": ">=0.68.0-dev.2 <1.0.0", + "@typespec/sse": ">=0.68.0-dev.2 <1.0.0", + "@typespec/streams": ">=0.68.0-dev.2 <1.0.0", + "@azure-tools/typespec-azure-core": ">=0.54.0-dev.5 <1.0.0", + "@azure-tools/typespec-azure-resource-manager": ">=0.54.0-dev.3 <1.0.0", + "@azure-tools/typespec-autorest": ">=0.54.0-dev.5 <1.0.0", + "@azure-tools/typespec-azure-rulesets": ">=0.54.0-dev.2 <3.0.0", + "@azure-tools/typespec-client-generator-core": ">=0.54.0-dev.16 <1.0.0" }, "dependencies": { "js-yaml": "~4.1.0", "semver": "~7.6.2", "tsx": "~4.19.1", - "@typespec/http-client-python": "~0.8.3-dev.2", + "@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcwNTAzNi9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.2.tgz", "fs-extra": "~11.2.0" }, "devDependencies": { - "@typespec/compiler": "~0.67.0", - "@typespec/http": "~0.67.0", - "@typespec/rest": "~0.67.0", - "@typespec/versioning": "~0.67.0", - "@typespec/openapi": "~0.67.0", - "@typespec/events": "~0.67.0", - "@typespec/sse": "~0.67.0", - "@typespec/streams": "~0.67.0", - "@azure-tools/typespec-azure-resource-manager": "~0.53.0", - "@azure-tools/typespec-azure-core": "~0.53.0", - "@azure-tools/typespec-azure-rulesets": "~0.53.0", - "@azure-tools/typespec-autorest": "~0.53.0", - "@azure-tools/typespec-client-generator-core": "~0.53.1", - "@azure-tools/azure-http-specs": "0.1.0-alpha.10", - "@typespec/http-specs": "0.1.0-alpha.15-dev.3", + "@typespec/compiler": "~0.68.0-dev.11", + "@typespec/http": "~0.68.0-dev.8", + "@typespec/rest": "~0.68.0-dev.3", + "@typespec/versioning": "~0.68.0-dev.2", + "@typespec/openapi": "~0.68.0-dev.3", + "@typespec/events": "~0.68.0-dev.2", + "@typespec/sse": "~0.68.0-dev.2", + "@typespec/streams": "~0.68.0-dev.2", + "@azure-tools/typespec-azure-resource-manager": "~0.54.0-dev.3", + "@azure-tools/typespec-azure-core": "~0.54.0-dev.5", + "@azure-tools/typespec-azure-rulesets": "~0.54.0-dev.2", + "@azure-tools/typespec-autorest": "~0.54.0-dev.5", + "@azure-tools/typespec-client-generator-core": "~0.54.0-dev.16", + "@azure-tools/azure-http-specs": "0.1.0-alpha.13-dev.1", + "@typespec/http-specs": "0.1.0-alpha.17-dev.1", "@types/js-yaml": "~4.0.5", "@types/node": "~22.5.4", "@types/yargs": "~17.0.33", @@ -95,4 +95,4 @@ "chalk": "5.3.0", "@types/fs-extra": "11.0.4" } -} +} \ No newline at end of file diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 62462f6d25b..28655f46ad7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -57,8 +57,8 @@ importers: specifier: ~1.0.2 version: 1.0.2 '@typespec/http-client-python': - specifier: ~0.8.3-dev.2 - version: 0.8.3-dev.2(c25h2yeksuorzcqz3v4sac5zy4) + specifier: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcwNTAzNi9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.2.tgz + version: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcwNTAzNi9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.2.tgz(iqakddphdaprnwwnwak65rubwq) fs-extra: specifier: ~11.2.0 version: 11.2.0 @@ -79,8 +79,8 @@ importers: packages/typespec-python: dependencies: '@typespec/http-client-python': - specifier: ~0.8.3-dev.2 - version: 0.8.3-dev.2(kvm224o5qzo556uchxhfoioziu) + specifier: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcwNTAzNi9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.2.tgz + version: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcwNTAzNi9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.2.tgz(iutp5t4avvqu5ejcubt66dygha) fs-extra: specifier: ~11.2.0 version: 11.2.0 @@ -95,23 +95,23 @@ importers: version: 4.19.3 devDependencies: '@azure-tools/azure-http-specs': - specifier: 0.1.0-alpha.10 - version: 0.1.0-alpha.10(hxmxu44wsiwmqbpvyuomrsmujq) + specifier: 0.1.0-alpha.13-dev.1 + version: 0.1.0-alpha.13-dev.1(dkz3jopup3kcww2tc3n27h5adi) '@azure-tools/typespec-autorest': - specifier: ~0.53.0 - version: 0.53.0(e3cfoxkazmlklhsfsyiqwpleoq) + specifier: ~0.54.0-dev.5 + version: 0.54.0-dev.5(vbjiszjdl42dvuq2wpgzxde7nu) '@azure-tools/typespec-azure-core': - specifier: ~0.53.0 - version: 0.53.0(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))))(@typespec/rest@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))))) + specifier: ~0.54.0-dev.5 + version: 0.54.0-dev.5(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))(@typespec/rest@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))) '@azure-tools/typespec-azure-resource-manager': - specifier: ~0.53.0 - version: 0.53.0(felt6lfzt5orrlwrzxpkykwppa) + specifier: ~0.54.0-dev.3 + version: 0.54.0-dev.3(vvsjt7ss6dhpuzy2lahlecfu7a) '@azure-tools/typespec-azure-rulesets': - specifier: ~0.53.0 - version: 0.53.0(@azure-tools/typespec-azure-core@0.53.0(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))))(@typespec/rest@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))))))(@azure-tools/typespec-azure-resource-manager@0.53.0(felt6lfzt5orrlwrzxpkykwppa))(@azure-tools/typespec-client-generator-core@0.53.1(3qm5ewpnxvwkav6ttg6x7temqm))(@typespec/compiler@0.67.1(@types/node@22.5.5)) + specifier: ~0.54.0-dev.2 + version: 0.54.0-dev.2(@azure-tools/typespec-azure-core@0.54.0-dev.5(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))(@typespec/rest@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))))(@azure-tools/typespec-azure-resource-manager@0.54.0-dev.3(vvsjt7ss6dhpuzy2lahlecfu7a))(@azure-tools/typespec-client-generator-core@0.54.0-dev.17(bi3uo6v4m3cwrf7tvdzqjmlfka))(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)) '@azure-tools/typespec-client-generator-core': - specifier: ~0.53.1 - version: 0.53.1(3qm5ewpnxvwkav6ttg6x7temqm) + specifier: ~0.54.0-dev.16 + version: 0.54.0-dev.17(bi3uo6v4m3cwrf7tvdzqjmlfka) '@types/fs-extra': specifier: 11.0.4 version: 11.0.4 @@ -128,32 +128,32 @@ importers: specifier: ~17.0.33 version: 17.0.33 '@typespec/compiler': - specifier: ~0.67.0 - version: 0.67.1(@types/node@22.5.5) + specifier: ~0.68.0-dev.11 + version: 0.68.0-dev.12(@types/node@22.5.5) '@typespec/events': - specifier: ~0.67.0 - version: 0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5)) + specifier: ~0.68.0-dev.2 + version: 0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)) '@typespec/http': - specifier: ~0.67.0 - version: 0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))) + specifier: ~0.68.0-dev.8 + version: 0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))) '@typespec/http-specs': - specifier: 0.1.0-alpha.15-dev.3 - version: 0.1.0-alpha.15-dev.3(@types/node@22.5.5)(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))))(@typespec/rest@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5)))))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5)))(@typespec/versioning@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5)))(@typespec/xml@0.59.0(@typespec/compiler@0.67.1(@types/node@22.5.5))) + specifier: 0.1.0-alpha.17-dev.1 + version: 0.1.0-alpha.17-dev.1(@types/node@22.5.5)(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))(@typespec/rest@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)))))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)))(@typespec/versioning@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)))(@typespec/xml@0.59.0(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))) '@typespec/openapi': - specifier: ~0.67.0 - version: 0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5)))) + specifier: ~0.68.0-dev.3 + version: 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)))) '@typespec/rest': - specifier: ~0.67.0 - version: 0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5)))) + specifier: ~0.68.0-dev.3 + version: 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)))) '@typespec/sse': - specifier: ~0.67.0 - version: 0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/events@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5)))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))) + specifier: ~0.68.0-dev.2 + version: 0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/events@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))) '@typespec/streams': - specifier: ~0.67.0 - version: 0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5)) + specifier: ~0.68.0-dev.2 + version: 0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)) '@typespec/versioning': - specifier: ~0.67.0 - version: 0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5)) + specifier: ~0.68.0-dev.2 + version: 0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)) c8: specifier: ^10.1.3 version: 10.1.3 @@ -188,81 +188,77 @@ packages: resolution: {integrity: sha512-T21naRb6JDdjjn2s/zwr9iCIv/9jviL/PRtiWAhi+3UA2WKH2wrId2VqJa4uVD7iEV8BLkuGgFmMkaMBG26hFw==} engines: {node: '>=12.0.0'} - '@azure-tools/azure-http-specs@0.1.0-alpha.10': - resolution: {integrity: sha512-BhWKqX6EMx16jMylLQG1m+Ncl5xoycqOTgxmaUkWNlFT0xT4AZqq1P5l15DgS77imJqHqI9VDOqt/vzN0LCJAQ==} + '@azure-tools/azure-http-specs@0.1.0-alpha.13-dev.1': + resolution: {integrity: sha512-qsG3Vdk7/IP+Bl4w1m6EoSvKu+jVZDVmmOSZDGnSYNMy9qF0OCDyZAn9lSahBYNNsU+N1c2uZWaSt1OfcDiE9w==} engines: {node: '>=20.0.0'} peerDependencies: - '@azure-tools/typespec-azure-core': ^0.53.0 - '@typespec/compiler': ^0.67.1 - '@typespec/http': ^0.67.1 - '@typespec/rest': ^0.67.1 - '@typespec/versioning': ^0.67.1 - '@typespec/xml': ^0.67.1 + '@azure-tools/typespec-azure-core': ^0.53.0 || >=0.54.0-dev <0.54.0 + '@typespec/compiler': ^0.67.2 || >=0.68.0-dev <0.68.0 + '@typespec/http': ^0.67.1 || >=0.68.0-dev <0.68.0 + '@typespec/rest': ^0.67.1 || >=0.68.0-dev <0.68.0 + '@typespec/versioning': ^0.67.1 || >=0.68.0-dev <0.68.0 + '@typespec/xml': ^0.67.1 || >=0.68.0-dev <0.68.0 - '@azure-tools/typespec-autorest@0.53.0': - resolution: {integrity: sha512-9eAOTU/so8QOigMcy9YKA43jtMxccSP22wa7Is0ZiX59YTcaUDGlpI+6cFfmGH0tATGCOm5TvjyOkdrhNyKrPw==} + '@azure-tools/typespec-autorest@0.54.0-dev.5': + resolution: {integrity: sha512-jOB9mX76zd9GazTKJjLiET/F62bfhlFhbq7996WoA/CwkvfL55EuYTpfQbxsLdYySXooxYKc7QnYBmhL6CwvBA==} engines: {node: '>=20.0.0'} peerDependencies: - '@azure-tools/typespec-azure-core': ^0.53.0 - '@azure-tools/typespec-azure-resource-manager': ^0.53.0 - '@azure-tools/typespec-client-generator-core': ^0.53.0 - '@typespec/compiler': ^0.67.0 - '@typespec/http': ^0.67.0 - '@typespec/openapi': ^0.67.0 - '@typespec/rest': ^0.67.0 - '@typespec/versioning': ^0.67.0 - - '@azure-tools/typespec-azure-core@0.53.0': - resolution: {integrity: sha512-zG+DV58ApChmkIIoTZ+XMIRsYLm6DnysMofg0o1UEuY50mS71sjzavcwceT8pXekPHtcXkLyYfdd7FyxirCuUA==} + '@azure-tools/typespec-azure-core': ^0.53.0 || >=0.54.0-dev <0.54.0 + '@azure-tools/typespec-azure-resource-manager': ^0.53.0 || >=0.54.0-dev <0.54.0 + '@azure-tools/typespec-client-generator-core': ^0.53.1 || >=0.54.0-dev <0.54.0 + '@typespec/compiler': ^0.67.2 || >=0.68.0-dev <0.68.0 + '@typespec/http': ^0.67.1 || >=0.68.0-dev <0.68.0 + '@typespec/openapi': ^0.67.1 || >=0.68.0-dev <0.68.0 + '@typespec/rest': ^0.67.1 || >=0.68.0-dev <0.68.0 + '@typespec/versioning': ^0.67.1 || >=0.68.0-dev <0.68.0 + + '@azure-tools/typespec-azure-core@0.54.0-dev.5': + resolution: {integrity: sha512-Am9PNrnb/fUw9E0oWCZwsi2Znx8bFz4dLe1heo+GaDJOEsH1vLzwbOCspm1pVpeZVi58HnVh0gt4nsYprauIaQ==} engines: {node: '>=20.0.0'} peerDependencies: - '@typespec/compiler': ^0.67.0 - '@typespec/http': ^0.67.0 - '@typespec/rest': ^0.67.0 + '@typespec/compiler': ^0.67.2 || >=0.68.0-dev <0.68.0 + '@typespec/http': ^0.67.1 || >=0.68.0-dev <0.68.0 + '@typespec/rest': ^0.67.1 || >=0.68.0-dev <0.68.0 - '@azure-tools/typespec-azure-resource-manager@0.53.0': - resolution: {integrity: sha512-sHeB+HqETYiHoRgcUjr61rxzCn+ITnYrg2gFQ0ExIK/B26hQv50t+VHe1YdrprlqzSvElJD+CtoqQQZffridNw==} + '@azure-tools/typespec-azure-resource-manager@0.54.0-dev.3': + resolution: {integrity: sha512-HMAjd1AnZyFj3uVees0qy5BNFxRrlTT3XZQA2d8uEVbESlLBQrkX1z3AwJvaNnM7HoBmjYxs9BsTI9mg/jvRGg==} engines: {node: '>=20.0.0'} peerDependencies: - '@azure-tools/typespec-azure-core': ^0.53.0 - '@typespec/compiler': ^0.67.0 - '@typespec/http': ^0.67.0 - '@typespec/openapi': ^0.67.0 - '@typespec/rest': ^0.67.0 - '@typespec/versioning': ^0.67.0 - - '@azure-tools/typespec-azure-rulesets@0.53.0': - resolution: {integrity: sha512-TsQeFKNQEG0juFzf0dQt8iikPSXGHNyW9hbDrUNrbnjnFvpxUZlL+1aLyI2hBmhHvJQJpLzHViVgKhXTLLBvIQ==} + '@azure-tools/typespec-azure-core': ^0.53.0 || >=0.54.0-dev <0.54.0 + '@typespec/compiler': ^0.67.2 || >=0.68.0-dev <0.68.0 + '@typespec/http': ^0.67.1 || >=0.68.0-dev <0.68.0 + '@typespec/openapi': ^0.67.1 || >=0.68.0-dev <0.68.0 + '@typespec/rest': ^0.67.1 || >=0.68.0-dev <0.68.0 + '@typespec/versioning': ^0.67.1 || >=0.68.0-dev <0.68.0 + + '@azure-tools/typespec-azure-rulesets@0.54.0-dev.2': + resolution: {integrity: sha512-qW9nxMQh0eOxiEQWjM/ADhbIfOoVec/c/95pRBbX5DPL0rkj9u3iQxENyNDfcVfl7XGlG7/Z/cmwJYgvIj6RJA==} engines: {node: '>=20.0.0'} peerDependencies: - '@azure-tools/typespec-azure-core': ^0.53.0 - '@azure-tools/typespec-azure-resource-manager': ^0.53.0 - '@azure-tools/typespec-client-generator-core': ^0.53.0 - '@typespec/compiler': ^0.67.0 + '@azure-tools/typespec-azure-core': ^0.53.0 || >=0.54.0-dev <0.54.0 + '@azure-tools/typespec-azure-resource-manager': ^0.53.0 || >=0.54.0-dev <0.54.0 + '@azure-tools/typespec-client-generator-core': ^0.53.1 || >=0.54.0-dev <0.54.0 + '@typespec/compiler': ^0.67.1 || >=0.68.0-dev <0.68.0 - '@azure-tools/typespec-client-generator-core@0.53.1': - resolution: {integrity: sha512-BWHQQ9Kjsk23Rb0eZ6V6HI2Gr20n/LhxAKEuBChCFWLjrFMYyXrHtlUBK6j/9D2VqwjaurRQA2SVXx/wzGyvAg==} + '@azure-tools/typespec-client-generator-core@0.54.0-dev.17': + resolution: {integrity: sha512-Z+pSc18+K3PPdfmA4xi6VApQFMlqWhIOhO71v1/k/lGoBAi0D965X0TRYdqHeJ7iNPMfhh+G7GR2d31COEDSkw==} engines: {node: '>=20.0.0'} peerDependencies: - '@azure-tools/typespec-azure-core': ^0.53.0 - '@typespec/compiler': ^0.67.0 - '@typespec/events': ^0.67.0 - '@typespec/http': ^0.67.0 - '@typespec/openapi': ^0.67.0 - '@typespec/rest': ^0.67.0 - '@typespec/sse': ^0.67.0 - '@typespec/streams': ^0.67.0 - '@typespec/versioning': ^0.67.0 - '@typespec/xml': ^0.67.0 + '@azure-tools/typespec-azure-core': ^0.53.0 || >=0.54.0-dev <0.54.0 + '@typespec/compiler': ^0.67.2 || >=0.68.0-dev <0.68.0 + '@typespec/events': ^0.67.1 || >=0.68.0-dev <0.68.0 + '@typespec/http': ^0.67.1 || >=0.68.0-dev <0.68.0 + '@typespec/openapi': ^0.67.1 || >=0.68.0-dev <0.68.0 + '@typespec/rest': ^0.67.1 || >=0.68.0-dev <0.68.0 + '@typespec/sse': ^0.67.1 || >=0.68.0-dev <0.68.0 + '@typespec/streams': ^0.67.1 || >=0.68.0-dev <0.68.0 + '@typespec/versioning': ^0.67.1 || >=0.68.0-dev <0.68.0 + '@typespec/xml': ^0.67.1 || >=0.68.0-dev <0.68.0 '@azure/abort-controller@2.1.2': resolution: {integrity: sha512-nBrLsEWm4J2u5LpAPjxADTlq3trDgVZZXHNKabeXZtpq3d3AbN/KGO82R87rdDz5/lYB024rtEf10/q0urNgsA==} engines: {node: '>=18.0.0'} - '@azure/core-auth@1.8.0': - resolution: {integrity: sha512-YvFMowkXzLbXNM11yZtVLhUCmuG0ex7JKOH366ipjmHBhL3vpDcPAeWF+jf0X+jVXwFqo3UhsWUq4kH0ZPdu/g==} - engines: {node: '>=18.0.0'} - '@azure/core-auth@1.9.0': resolution: {integrity: sha512-FPwHpZywuyasDSLMqJ6fhbOK3TqUdviZNF8OqRGA4W5Ewib2lEEZ+pBsYcBa88B2NGO/SEnYPGhyBqNlE8ilSw==} engines: {node: '>=18.0.0'} @@ -291,10 +287,6 @@ packages: resolution: {integrity: sha512-dawW9ifvWAWmUm9/h+/UQ2jrdvjCJ7VJEuCJ6XVNudzcOwm53BFZH4Q845vjfgoUAM8ZxokvVNxNxAITc502YA==} engines: {node: '>=18.0.0'} - '@azure/core-util@1.10.0': - resolution: {integrity: sha512-dqLWQsh9Nro1YQU+405POVtXnwrIVqPyfUzc4zXCbThTg7+vNNaiMkwbX9AMXKyoFYFClxmB3s25ZFr3+jZkww==} - engines: {node: '>=18.0.0'} - '@azure/core-util@1.11.0': resolution: {integrity: sha512-DxOSLua+NdpWoSqULhjDyAZTXFdP/LKkqtYuxxz1SCN289zk3OG8UOpnCQAz/tygyACBtWp/BoO72ptK7msY8g==} engines: {node: '>=18.0.0'} @@ -307,6 +299,10 @@ packages: resolution: {integrity: sha512-6z/S2KorkbKaZ0DgZFVRdu7RCuATmMSTjKpuhj7YpjxkJ0vnJ7kTM3cpNgzFgk9OPYfZ31wrBEtC/iwAS4jQDA==} engines: {node: '>=18.0.0'} + '@azure/identity@4.8.0': + resolution: {integrity: sha512-l9ALUGHtFB/JfsqmA+9iYAp2a+cCwdNO/cyIr2y7nJLJsz1aae6qVP8XxT7Kbudg0IQRSIMXj0+iivFdbD1xPA==} + engines: {node: '>=18.0.0'} + '@azure/logger@1.1.4': resolution: {integrity: sha512-4IXXzcCdLdlXuCG+8UKEwLA1T1NHqUfanhXYHiQTn+6sfWCZXduqbtXDGceg3Ce5QxTGo7EqmbV6Bi+aqKuClQ==} engines: {node: '>=18.0.0'} @@ -335,10 +331,6 @@ packages: resolution: {integrity: sha512-SriLPKezypIsiZ+TtlFfE46uuBIap2HeaQVS78e1P7rz5OSbq0rsd52WE1mC5f7vAeLiXqv7I7oRhL3WFZEw3Q==} engines: {node: '>=18.0.0'} - '@babel/code-frame@7.24.7': - resolution: {integrity: sha512-BcYH1CVJBO9tvyIZ2jVeXgSIMvGZ2FDRvDdOIVQyuklNKSsx+eppDEBq/g47Ayw+RqNFE+URvOShmf+f/qwAlA==} - engines: {node: '>=6.9.0'} - '@babel/code-frame@7.26.2': resolution: {integrity: sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ==} engines: {node: '>=6.9.0'} @@ -351,10 +343,6 @@ packages: resolution: {integrity: sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==} engines: {node: '>=6.9.0'} - '@babel/highlight@7.24.7': - resolution: {integrity: sha512-EStJpq4OuY8xYfhGVXngigBJRWxftKX9ksiGDnmlY3o7B/V7KIAc9X4oiK87uPJSc/vs5L869bem5fhZa8caZw==} - engines: {node: '>=6.9.0'} - '@bcoe/v8-coverage@1.0.2': resolution: {integrity: sha512-6zABk/ECA/QYSCQ1NGiVwwbQerUCZ+TQbp64Q3AgmfNvurHH0j8TtXa1qbShXA6qqkpAj4V5W8pP6mLe1mcMqA==} engines: {node: '>=18'} @@ -912,6 +900,15 @@ packages: '@types/node': optional: true + '@inquirer/checkbox@4.1.4': + resolution: {integrity: sha512-d30576EZdApjAMceijXA5jDzRQHT/MygbC+J8I7EqA6f/FRpYxlRtRJbHF8gHeWYeSdOuTEJqonn7QLB1ELezA==} + engines: {node: '>=18'} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + '@inquirer/confirm@5.1.6': resolution: {integrity: sha512-6ZXYK3M1XmaVBZX6FCfChgtponnL0R6I7k8Nu+kaoNkT828FVZTcca1MqmWQipaW2oNREQl5AaPCUOOCVNdRMw==} engines: {node: '>=18'} @@ -921,6 +918,15 @@ packages: '@types/node': optional: true + '@inquirer/confirm@5.1.8': + resolution: {integrity: sha512-dNLWCYZvXDjO3rnQfk2iuJNL4Ivwz/T2+C3+WnNfJKsNGSuOs3wAo2F6e0p946gtSAk31nZMfW+MRmYaplPKsg==} + engines: {node: '>=18'} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + '@inquirer/core@10.1.7': resolution: {integrity: sha512-AA9CQhlrt6ZgiSy6qoAigiA1izOa751ugX6ioSjqgJ+/Gd+tEN/TORk5sUYNjXuHWfW0r1n/a6ak4u/NqHHrtA==} engines: {node: '>=18'} @@ -930,6 +936,15 @@ packages: '@types/node': optional: true + '@inquirer/core@10.1.9': + resolution: {integrity: sha512-sXhVB8n20NYkUBfDYgizGHlpRVaCRjtuzNZA6xpALIUbkgfd2Hjz+DfEN6+h1BRnuxw0/P4jCIMjMsEOAMwAJw==} + engines: {node: '>=18'} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + '@inquirer/editor@4.2.7': resolution: {integrity: sha512-gktCSQtnSZHaBytkJKMKEuswSk2cDBuXX5rxGFv306mwHfBPjg5UAldw9zWGoEyvA9KpRDkeM4jfrx0rXn0GyA==} engines: {node: '>=18'} @@ -939,6 +954,24 @@ packages: '@types/node': optional: true + '@inquirer/editor@4.2.9': + resolution: {integrity: sha512-8HjOppAxO7O4wV1ETUlJFg6NDjp/W2NP5FB9ZPAcinAlNT4ZIWOLe2pUVwmmPRSV0NMdI5r/+lflN55AwZOKSw==} + engines: {node: '>=18'} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/expand@4.0.11': + resolution: {integrity: sha512-OZSUW4hFMW2TYvX/Sv+NnOZgO8CHT2TU1roUCUIF2T+wfw60XFRRp9MRUPCT06cRnKL+aemt2YmTWwt7rOrNEA==} + engines: {node: '>=18'} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + '@inquirer/expand@4.0.9': resolution: {integrity: sha512-Xxt6nhomWTAmuSX61kVgglLjMEFGa+7+F6UUtdEUeg7fg4r9vaFttUUKrtkViYYrQBA5Ia1tkOJj2koP9BuLig==} engines: {node: '>=18'} @@ -952,6 +985,10 @@ packages: resolution: {integrity: sha512-Ey6176gZmeqZuY/W/nZiUyvmb1/qInjcpiZjXWi6nON+nxJpD1bxtSoBxNliGISae32n6OwbY+TSXPZ1CfS4bw==} engines: {node: '>=18'} + '@inquirer/figures@1.0.11': + resolution: {integrity: sha512-eOg92lvrn/aRUqbxRyvpEWnrvRuTYRifixHkYVpJiygTgVSBIHDqLh0SrMQXkafvULg3ck11V7xvR+zcgvpHFw==} + engines: {node: '>=18'} + '@inquirer/input@4.1.6': resolution: {integrity: sha512-1f5AIsZuVjPT4ecA8AwaxDFNHny/tSershP/cTvTDxLdiIGTeILNcKozB0LaYt6mojJLUbOYhpIxicaYf7UKIQ==} engines: {node: '>=18'} @@ -961,6 +998,24 @@ packages: '@types/node': optional: true + '@inquirer/input@4.1.8': + resolution: {integrity: sha512-WXJI16oOZ3/LiENCAxe8joniNp8MQxF6Wi5V+EBbVA0ZIOpFcL4I9e7f7cXse0HJeIPCWO8Lcgnk98juItCi7Q==} + engines: {node: '>=18'} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/number@3.0.11': + resolution: {integrity: sha512-pQK68CsKOgwvU2eA53AG/4npRTH2pvs/pZ2bFvzpBhrznh8Mcwt19c+nMO7LHRr3Vreu1KPhNBF3vQAKrjIulw==} + engines: {node: '>=18'} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + '@inquirer/number@3.0.9': resolution: {integrity: sha512-iN2xZvH3tyIYXLXBvlVh0npk1q/aVuKXZo5hj+K3W3D4ngAEq/DkLpofRzx6oebTUhBvOgryZ+rMV0yImKnG3w==} engines: {node: '>=18'} @@ -970,6 +1025,15 @@ packages: '@types/node': optional: true + '@inquirer/password@4.0.11': + resolution: {integrity: sha512-dH6zLdv+HEv1nBs96Case6eppkRggMe8LoOTl30+Gq5Wf27AO/vHFgStTVz4aoevLdNXqwE23++IXGw4eiOXTg==} + engines: {node: '>=18'} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + '@inquirer/password@4.0.9': resolution: {integrity: sha512-xBEoOw1XKb0rIN208YU7wM7oJEHhIYkfG7LpTJAEW913GZeaoQerzf5U/LSHI45EVvjAdgNXmXgH51cUXKZcJQ==} engines: {node: '>=18'} @@ -988,6 +1052,24 @@ packages: '@types/node': optional: true + '@inquirer/prompts@7.4.0': + resolution: {integrity: sha512-EZiJidQOT4O5PYtqnu1JbF0clv36oW2CviR66c7ma4LsupmmQlUwmdReGKRp456OWPWMz3PdrPiYg3aCk3op2w==} + engines: {node: '>=18'} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + + '@inquirer/rawlist@4.0.11': + resolution: {integrity: sha512-uAYtTx0IF/PqUAvsRrF3xvnxJV516wmR6YVONOmCWJbbt87HcDHLfL9wmBQFbNJRv5kCjdYKrZcavDkH3sVJPg==} + engines: {node: '>=18'} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + '@inquirer/rawlist@4.0.9': resolution: {integrity: sha512-+5t6ebehKqgoxV8fXwE49HkSF2Rc9ijNiVGEQZwvbMI61/Q5RcD+jWD6Gs1tKdz5lkI8GRBL31iO0HjGK1bv+A==} engines: {node: '>=18'} @@ -997,6 +1079,15 @@ packages: '@types/node': optional: true + '@inquirer/search@3.0.11': + resolution: {integrity: sha512-9CWQT0ikYcg6Ls3TOa7jljsD7PgjcsYEM0bYE+Gkz+uoW9u8eaJCRHJKkucpRE5+xKtaaDbrND+nPDoxzjYyew==} + engines: {node: '>=18'} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + '@inquirer/search@3.0.9': resolution: {integrity: sha512-DWmKztkYo9CvldGBaRMr0ETUHgR86zE6sPDVOHsqz4ISe9o1LuiWfgJk+2r75acFclA93J/lqzhT0dTjCzHuoA==} engines: {node: '>=18'} @@ -1015,6 +1106,15 @@ packages: '@types/node': optional: true + '@inquirer/select@4.1.0': + resolution: {integrity: sha512-z0a2fmgTSRN+YBuiK1ROfJ2Nvrpij5lVN3gPDkQGhavdvIVGHGW29LwYZfM/j42Ai2hUghTI/uoBuTbrJk42bA==} + engines: {node: '>=18'} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + '@inquirer/type@3.0.4': resolution: {integrity: sha512-2MNFrDY8jkFYc9Il9DgLsHhMzuHnOYM1+CUYVWbzu9oT0hC7V7EcYvdCKeoll/Fcci04A+ERZ9wcc7cQ8lTkIA==} engines: {node: '>=18'} @@ -1024,6 +1124,15 @@ packages: '@types/node': optional: true + '@inquirer/type@3.0.5': + resolution: {integrity: sha512-ZJpeIYYueOz/i/ONzrfof8g89kNdO2hjGuvULROo3O8rlB2CRtSseE5KeirnyE4t/thAn/EwvS/vuQeJCn+NZg==} + engines: {node: '>=18'} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + '@isaacs/cliui@8.0.2': resolution: {integrity: sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==} engines: {node: '>=12'} @@ -1534,40 +1643,46 @@ packages: resolution: {integrity: sha512-b1tx0orFCCh/THWPQa2ZwWzvOeyzzp36vkJYOpVg0u8UVOIsfVrnuC9FqAw9gRKn+rG2VmWQ/zDJZzkxUnj/XQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@typespec/compiler@0.67.1': - resolution: {integrity: sha512-inaJUlbwvFBNiT8ViXZ4O2m0ECiLPkkp0Ek1wNquxpWNHxgvfFDH/JTv5SXXwL5FXY+uym9hNcyjmHQB7RJExw==} + '@typespec/compiler@0.67.2': + resolution: {integrity: sha512-6c47359nR6IjI4fYq+0hi1mm9GMdHQ/LdqPa/roKg1wQaBohUMBJXW7duMDcz2BTorYjoEBYalz9olMG4oqZDA==} engines: {node: '>=20.0.0'} hasBin: true - '@typespec/events@0.67.1': - resolution: {integrity: sha512-4pd/FEd+y72h2eUOlwGavK+nv3SDp7ZUJkGTcARyjLH5aSIAOl4uYW+WzQjGJylu/9t+xmoHy47siOvYBxONkQ==} + '@typespec/compiler@0.68.0-dev.12': + resolution: {integrity: sha512-Sl8eNWOUYytWZ7PjjIi7V9ZkGbp5+e2Ja3YSLrFYQ2fRaUIgWPS+Pc4Cw18iQgg7E+Uc4tvdRtziT7z1nZqCiw==} + engines: {node: '>=20.0.0'} + hasBin: true + + '@typespec/events@0.68.0-dev.2': + resolution: {integrity: sha512-Vplgg6Za7gh4gxYKrhVz2AEAmv0BiE/xYxyLPdt0yChS07hhfhVC1a3Fw8pAX30AJqnMKV4YX9177axA58SZzw==} engines: {node: '>=20.0.0'} peerDependencies: - '@typespec/compiler': ^0.67.1 + '@typespec/compiler': ^0.67.1 || >=0.68.0-dev <0.68.0 - '@typespec/http-client-python@0.8.3-dev.2': - resolution: {integrity: sha512-XN5H5N4qZzsUHoM0cH97tHZ6DBYROWDD/L5YFjRykLy/6UwcE/PRNID8KmQocFlTXjCLExs1qtw4fcxizfgEsQ==} + '@typespec/http-client-python@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcwNTAzNi9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.2.tgz': + resolution: {tarball: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcwNTAzNi9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.2.tgz} + version: 0.8.2 engines: {node: '>=20.0.0'} peerDependencies: - '@azure-tools/typespec-autorest': '>=0.53.0 <1.0.0' - '@azure-tools/typespec-azure-core': '>=0.53.0 <1.0.0' - '@azure-tools/typespec-azure-resource-manager': '>=0.53.0 <1.0.0' - '@azure-tools/typespec-azure-rulesets': '>=0.53.0 <3.0.0' - '@azure-tools/typespec-client-generator-core': '>=0.53.1 <1.0.0' - '@typespec/compiler': '>=0.67.0 <1.0.0' - '@typespec/events': '>=0.67.0 <1.0.0' - '@typespec/http': '>=0.67.0 <1.0.0' - '@typespec/openapi': '>=0.67.0 <1.0.0' - '@typespec/rest': '>=0.67.0 <1.0.0' - '@typespec/sse': '>=0.67.0 <1.0.0' - '@typespec/streams': '>=0.67.0 <1.0.0' - '@typespec/versioning': '>=0.67.0 <1.0.0' - - '@typespec/http-specs@0.1.0-alpha.15-dev.3': - resolution: {integrity: sha512-pWrtceHjixwFv6SX1nkSu5WG7odm83FqnKLVzmO5Y29MD4DCgu1AhqtDM7UJ1GZgfHPbZS0zh9gj/01vxEhkdQ==} + '@azure-tools/typespec-autorest': '>=0.54.0-dev.5 <1.0.0' + '@azure-tools/typespec-azure-core': '>=0.54.0-dev.5 <1.0.0' + '@azure-tools/typespec-azure-resource-manager': '>=0.54.0-dev.3 <1.0.0' + '@azure-tools/typespec-azure-rulesets': '>=0.54.0-dev.2 <3.0.0' + '@azure-tools/typespec-client-generator-core': '>=0.54.0-dev.16 <1.0.0' + '@typespec/compiler': '>=0.68.0-dev.11 <1.0.0' + '@typespec/events': '>=0.68.0-dev.2 <1.0.0' + '@typespec/http': '>=0.68.0-dev.8 <1.0.0' + '@typespec/openapi': '>=0.68.0-dev.3 <1.0.0' + '@typespec/rest': '>=0.68.0-dev.3 <1.0.0' + '@typespec/sse': '>=0.68.0-dev.2 <1.0.0' + '@typespec/streams': '>=0.68.0-dev.2 <1.0.0' + '@typespec/versioning': '>=0.68.0-dev.2 <1.0.0' + + '@typespec/http-specs@0.1.0-alpha.17-dev.1': + resolution: {integrity: sha512-OpKCqt/deTme51fktbEBzJ7D6ZaS69vXjhLqdvbMBGPJxjLtLMY53pmv+xOA9I0IWLvavlPD4BXEYysIwshufA==} engines: {node: '>=16.0.0'} peerDependencies: - '@typespec/compiler': ^0.67.1 || >=0.68.0-dev <0.68.0 + '@typespec/compiler': ^0.67.2 || >=0.68.0-dev <0.68.0 '@typespec/http': ^0.67.1 || >=0.68.0-dev <0.68.0 '@typespec/rest': ^0.67.1 || >=0.68.0-dev <0.68.0 '@typespec/versioning': ^0.67.1 || >=0.68.0-dev <0.68.0 @@ -1583,12 +1698,22 @@ packages: '@typespec/streams': optional: true - '@typespec/openapi@0.67.1': - resolution: {integrity: sha512-9/122dHw6ZA+laqHM1mqa0CWxg0lBhEqdVX74YoAOlE+NR2wIpUwwC4WIVTvIllDIl6hwV+zVgILtbvD8W5+1A==} + '@typespec/http@0.68.0-dev.8': + resolution: {integrity: sha512-A1IcrANbTYVhR4bjrsjI2UJ5PpkvFwcn/w9nZnjrQ74lDOx171HmcSRKpUzQFSskW9f/iOaWwj8f79rOtHnY3g==} engines: {node: '>=20.0.0'} peerDependencies: - '@typespec/compiler': ^0.67.1 - '@typespec/http': ^0.67.1 + '@typespec/compiler': ^0.67.2 || >=0.68.0-dev <0.68.0 + '@typespec/streams': ^0.67.1 || >=0.68.0-dev <0.68.0 + peerDependenciesMeta: + '@typespec/streams': + optional: true + + '@typespec/openapi@0.68.0-dev.3': + resolution: {integrity: sha512-iBj6c1SyDqOgoFT/Kc+R3C4xZE+jQhqTlqRiXf4BKsENYCDhsAmA0nI/Sl1kFFIBm8TD2egcMQzYRlyo3sHnbQ==} + engines: {node: '>=20.0.0'} + peerDependencies: + '@typespec/compiler': ^0.67.2 || >=0.68.0-dev <0.68.0 + '@typespec/http': ^0.67.1 || >=0.68.0-dev <0.68.0 '@typespec/rest@0.67.1': resolution: {integrity: sha512-19IzFoaM0yFBSXpfrJgZEBVXtvEkMEprKc5B0kF4ylEPs32ShtZj05BXYrAkmMZbCsk0AC/VZdmVgcWP+AT6GQ==} @@ -1597,6 +1722,13 @@ packages: '@typespec/compiler': ^0.67.1 '@typespec/http': ^0.67.1 + '@typespec/rest@0.68.0-dev.3': + resolution: {integrity: sha512-Wwm+UlFuUMUJ2gkdEKDMiYve1MLfYpEP2fgF+9HwhrMIagDw7C/Jgt3o3PTRvonD5SKx1n5wne4/EL+K8Q0F4A==} + engines: {node: '>=20.0.0'} + peerDependencies: + '@typespec/compiler': ^0.67.1 || >=0.68.0-dev <0.68.0 + '@typespec/http': ^0.67.1 || >=0.68.0-dev <0.68.0 + '@typespec/spec-api@0.1.0-alpha.3-dev.0': resolution: {integrity: sha512-zMozvoCEDERYvGMgT2EvuNyIcaFvf3pUXWhc7jyhJK2zI0z2ELnT4gUEynJ3ugI/ICaWtxHrGkwueaf508a5gQ==} engines: {node: '>=20.0.0'} @@ -1605,25 +1737,25 @@ packages: resolution: {integrity: sha512-I0p1ogrB3hW16K9IJyxFUz6AvuQ8NDsiLrav5ujGGJbW3gXdp+N6MzxXp5NNs4jfHoryX4kkA7xlTiPqKz3Pcw==} engines: {node: '>=16.0.0'} - '@typespec/spector@0.1.0-alpha.9': - resolution: {integrity: sha512-plD3bZGqk1v2+pJoZl/TNxWlkS7mMzPNPtd+HkKbjmFxQfFUQGPvmkRq4YGijj9gjqcwYXrzQ10L8/emv9ZnoQ==} + '@typespec/spector@0.1.0-alpha.10': + resolution: {integrity: sha512-2M/LwXh+YKf0lT9tLV5a9OSI99g8X8ZeyHIUUenddE99gFqi41ql92k1LW/CT1jz4/pmoXMnWx3L+U439EXcHg==} engines: {node: '>=16.0.0'} hasBin: true - '@typespec/sse@0.67.1': - resolution: {integrity: sha512-Y7O002u89nM55hc81/wadMG0+gnj9hr0i4icqOxjP7auWsYDwMoK7arxC+qM7tyyFGMgv/F0ZxNJmc2Ajq7kpQ==} + '@typespec/sse@0.68.0-dev.2': + resolution: {integrity: sha512-tK5R8F6tihUx5jbuMeFFrKRecV2HIkBD+v4CH/ofPZi+2dtIZe9UxEOeRPezJ1nollfwwd3v2aGihPG6nNl1Kw==} engines: {node: '>=20.0.0'} peerDependencies: - '@typespec/compiler': ^0.67.1 - '@typespec/events': ^0.67.1 - '@typespec/http': ^0.67.1 - '@typespec/streams': ^0.67.1 + '@typespec/compiler': ^0.67.1 || >=0.68.0-dev <0.68.0 + '@typespec/events': ^0.67.1 || >=0.68.0-dev <0.68.0 + '@typespec/http': ^0.67.1 || >=0.68.0-dev <0.68.0 + '@typespec/streams': ^0.67.1 || >=0.68.0-dev <0.68.0 - '@typespec/streams@0.67.1': - resolution: {integrity: sha512-it+WNzurrk+TEzLvqlbCreyATmSR/g61/YX/k1D+B/QThPv8bh2S1sQqKtUMeThCu4/MHhZL9xTtdxWcLww+lg==} + '@typespec/streams@0.68.0-dev.2': + resolution: {integrity: sha512-wsy6uONEST8iLFznLpM/OSmP1WxQajK4oN+f0UNJz+Q3gJseH8P8K3WvCO8qN8oYBAR4LjMk06diFTnfT3zrWQ==} engines: {node: '>=20.0.0'} peerDependencies: - '@typespec/compiler': ^0.67.1 + '@typespec/compiler': ^0.67.1 || >=0.68.0-dev <0.68.0 '@typespec/versioning@0.67.1': resolution: {integrity: sha512-i1eZT8JlCthkRHJS3NH/nZTHUD7gJozP6pVy8wyHBx6TbnDOTfQ1P5YVlL2pF4ZdeRbGFhOKiUF/usEIOrkaVw==} @@ -1631,6 +1763,12 @@ packages: peerDependencies: '@typespec/compiler': ^0.67.1 + '@typespec/versioning@0.68.0-dev.2': + resolution: {integrity: sha512-MUKf6peqW0aqOqGd2UaLLGg+prJ2ZSsyGoa0JkRfZFgu8n6z2BnqCZkCpppdimUx4s87wXBwCGKnQ4ECUTAZ0A==} + engines: {node: '>=20.0.0'} + peerDependencies: + '@typespec/compiler': ^0.67.1 || >=0.68.0-dev <0.68.0 + '@typespec/xml@0.59.0': resolution: {integrity: sha512-UoSsEmm7SXEtL9OXsqotu1TjruJSobqZMhUKAAlC9EP2WfQIHLRfBu7xaZB0sgwq7CM6zy/Hq1RZfQyL1KqEvg==} engines: {node: '>=18.0.0'} @@ -1714,10 +1852,6 @@ packages: resolution: {integrity: sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==} engines: {node: '>=12'} - ansi-styles@3.2.1: - resolution: {integrity: sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==} - engines: {node: '>=4'} - ansi-styles@4.3.0: resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} engines: {node: '>=8'} @@ -1769,9 +1903,6 @@ packages: async@3.2.6: resolution: {integrity: sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==} - asynckit@0.4.0: - resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} - autorest@3.7.1: resolution: {integrity: sha512-6q17NtosQZPqBkIOUnaOPedf3PDIBF7Ha1iEGRhTqZF6TG2Q/1E3ID/D+ePIIzZDKvW01p/2pENq/oiBWH9IGQ==} engines: {node: '>=12.0.0'} @@ -1781,9 +1912,6 @@ packages: resolution: {integrity: sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==} engines: {node: '>= 0.4'} - axios@1.8.1: - resolution: {integrity: sha512-NN+fvwH/kV01dYUQ3PTOZns4LWtWhOFCAhQ/pHb88WQ1hNe5V/dvFwc4VJcDL11LT9xSX0QtsR8sWUuyOuOq7g==} - balanced-match@1.0.2: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} @@ -1882,10 +2010,6 @@ packages: resolution: {integrity: sha512-T2VJbcDuZQ0Tb2EWwSotMPJjgpy1/tGee1BTpUNsGZ/qgNjV2t7Mvu+d4600U564nbLesN1x2dPL+xii174Ekg==} engines: {node: '>=14.16'} - chalk@2.4.2: - resolution: {integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==} - engines: {node: '>=4'} - chalk@4.1.2: resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} engines: {node: '>=10'} @@ -1966,10 +2090,6 @@ packages: colorspace@1.1.4: resolution: {integrity: sha512-BgvKJiuVu1igBUF2kEjRCZXol6wiiGbY5ipL/oVPwm0BL9sIpMIzM8IK7vwuxIIzOXMV3Ey5w+vxhm0rR/TN8w==} - combined-stream@1.0.8: - resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} - engines: {node: '>= 0.8'} - command-exists@1.2.9: resolution: {integrity: sha512-LTQ/SGc+s0Xc0Fu5WaKnR0YiygZkm9eKFvyS+fRsU7/ZWFF8ykFM6Pc9aCVf1+xasOOZpO3BAVgVrKvsqKHV7w==} @@ -2089,10 +2209,6 @@ packages: engines: {node: '>=16'} hasBin: true - data-uri-to-buffer@4.0.1: - resolution: {integrity: sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==} - engines: {node: '>= 12'} - data-view-buffer@1.0.1: resolution: {integrity: sha512-0lht7OugA5x3iJLOWFhWK/5ehONdprk0ISXqVFn/NFrDu+cuc8iADFrGQz5BnRK7LLU3JmkbXSxaqX+/mXYtUA==} engines: {node: '>= 0.4'} @@ -2170,10 +2286,6 @@ packages: resolution: {integrity: sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==} engines: {node: '>= 0.4'} - delayed-stream@1.0.0: - resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} - engines: {node: '>=0.4.0'} - depd@2.0.0: resolution: {integrity: sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==} engines: {node: '>= 0.8'} @@ -2274,10 +2386,6 @@ packages: es-module-lexer@1.6.0: resolution: {integrity: sha512-qqnD1yMU6tk/jnaMosogGySTZP8YtUgAffA9nMN+E/rjxcfRQ6IEk7IiozUjgxKoFHBGjTLnrHB/YC45r/59EQ==} - es-object-atoms@1.0.0: - resolution: {integrity: sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==} - engines: {node: '>= 0.4'} - es-object-atoms@1.1.1: resolution: {integrity: sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==} engines: {node: '>= 0.4'} @@ -2490,10 +2598,6 @@ packages: fecha@4.2.3: resolution: {integrity: sha512-OP2IUU6HeYKJi3i0z4A19kHMQoLVs4Hc+DPqqxI2h/DPZHTm/vjsfC6P0b4jCMy14XizLBqvndQ+UilD7707Jw==} - fetch-blob@3.2.0: - resolution: {integrity: sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==} - engines: {node: ^12.20 || >= 14.13} - file-entry-cache@7.0.2: resolution: {integrity: sha512-TfW7/1iI4Cy7Y8L6iqNdZQVvdXn0f8B4QcIXmkIbtTIe/Okm/nSlHb4IwGzRVOd3WfSieCgvf5cMzEfySAIl0g==} engines: {node: '>=12.0.0'} @@ -2536,15 +2640,6 @@ packages: fn.name@1.1.0: resolution: {integrity: sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw==} - follow-redirects@1.15.9: - resolution: {integrity: sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==} - engines: {node: '>=4.0'} - peerDependencies: - debug: '*' - peerDependenciesMeta: - debug: - optional: true - for-each@0.3.3: resolution: {integrity: sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==} @@ -2552,14 +2647,6 @@ packages: resolution: {integrity: sha512-Ld2g8rrAyMYFXBhEqMz8ZAHBi4J4uS1i/CxGMDnjyFWddMXLVcDp051DZfu+t7+ab7Wv6SMqpWmyFIj5UbfFvg==} engines: {node: '>=14'} - form-data@4.0.2: - resolution: {integrity: sha512-hGfm/slu0ZabnNt4oaRZ6uREyfCj6P4fT/n6A1rGV+Z0VdGXjfOhVUpkn6qVQONHGIFwmveGXyDs75+nr6FM8w==} - engines: {node: '>= 6'} - - formdata-polyfill@4.0.10: - resolution: {integrity: sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==} - engines: {node: '>=12.20.0'} - forwarded@0.2.0: resolution: {integrity: sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==} engines: {node: '>= 0.6'} @@ -2613,10 +2700,6 @@ packages: get-func-name@2.0.2: resolution: {integrity: sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==} - get-intrinsic@1.2.4: - resolution: {integrity: sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==} - engines: {node: '>= 0.4'} - get-intrinsic@1.3.0: resolution: {integrity: sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==} engines: {node: '>= 0.4'} @@ -2699,10 +2782,6 @@ packages: has-bigints@1.0.2: resolution: {integrity: sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==} - has-flag@3.0.0: - resolution: {integrity: sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==} - engines: {node: '>=4'} - has-flag@4.0.0: resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} engines: {node: '>=8'} @@ -2718,10 +2797,6 @@ packages: resolution: {integrity: sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==} engines: {node: '>= 0.4'} - has-symbols@1.0.3: - resolution: {integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==} - engines: {node: '>= 0.4'} - has-symbols@1.1.0: resolution: {integrity: sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==} engines: {node: '>= 0.4'} @@ -3004,10 +3079,6 @@ packages: resolution: {integrity: sha512-cub8rahkh0Q/bw1+GxP7aeSe29hHHn2V4m29nnDlvCdlgU+3UGxkZp7Z53jLUdpX3jdTO0nJZUDl3xvbWc2Xog==} engines: {node: 20 || >=22} - jackspeak@4.1.0: - resolution: {integrity: sha512-9DDdhb5j6cpeitCbvLO7n7J4IxnbM6hoF6O1g4HQ5TfhvvKN8ywDM7668ZhMHRqVmxqhps/F6syWK2KcPxYlkw==} - engines: {node: 20 || >=22} - js-tokens@4.0.0: resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} @@ -3136,10 +3207,6 @@ packages: resolution: {integrity: sha512-i24m8rpwhmPIS4zscNzK6MSEhk0DUWa/8iYQWxhffV8jkI4Phvs3F+quL5xvS0gdQR0FyTCMMH33Y78dDTzzIw==} engines: {node: '>=18'} - logform@2.6.1: - resolution: {integrity: sha512-CdaO738xRapbKIMVn2m4F6KTj4j7ooJ8POVnebSgKo3KBz5axNXRAL7ZdRjIV6NOr2Uf4vjtRkxrFETOioCqSA==} - engines: {node: '>= 12.0.0'} - logform@2.7.0: resolution: {integrity: sha512-TFYA4jnP7PVbmlBIfhlSe+WKxs9dklXMTEGcBCIvLhE/Tn3H6Gk1norupVW7m5Cnd4bLcr08AytbyV/xj7f/kQ==} engines: {node: '>= 12.0.0'} @@ -3306,6 +3373,10 @@ packages: resolution: {integrity: sha512-ywPWvcDMeH+z9gQq5qYHCCy+ethsk4goepZ45GLD63fOu0YcNecQxi64nDs3qluZB+murG3/D4dJ7+dGctcCQQ==} engines: {node: '>= 6.0.0'} + multer@1.4.5-lts.2: + resolution: {integrity: sha512-VzGiVigcG9zUAoCNU+xShztrlr1auZOlurXynNvO9GiWD1/mTBbUljOKY+qMeazBqXgRnjzeEgJI/wyjJUHg9A==} + engines: {node: '>= 6.0.0'} + mustache@4.2.0: resolution: {integrity: sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ==} hasBin: true @@ -3326,10 +3397,6 @@ packages: resolution: {integrity: sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==} engines: {node: '>= 0.6'} - node-domexception@1.0.0: - resolution: {integrity: sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==} - engines: {node: '>=10.5.0'} - node-fetch@2.7.0: resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==} engines: {node: 4.x || >=6.0.0} @@ -3339,10 +3406,6 @@ packages: encoding: optional: true - node-fetch@3.3.2: - resolution: {integrity: sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - node-gyp@10.2.0: resolution: {integrity: sha512-sp3FonBAaFe4aYTcFdZUn2NYkbP7xroPGYvQmP4Nl5PxamznItBnNCgjrVTKrEfQynInMsJvZrdmqUnysCJ8rw==} engines: {node: ^16.14.0 || >=18.0.0} @@ -3636,9 +3699,6 @@ packages: resolution: {integrity: sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==} engines: {node: '>= 0.10'} - proxy-from-env@1.1.0: - resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} - punycode@2.3.1: resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} engines: {node: '>=6'} @@ -3991,10 +4051,6 @@ packages: strnum@1.0.5: resolution: {integrity: sha512-J8bbNyKKXl5qYcR36TIO8W3mVGVHrmmxsd5PAItGkmyzwJvybiw2IVq5nqd0i4LSNSkB/sx9VHllbfFdr9k1JA==} - supports-color@5.5.0: - resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==} - engines: {node: '>=4'} - supports-color@7.2.0: resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} engines: {node: '>=8'} @@ -4356,10 +4412,6 @@ packages: vscode-uri@3.1.0: resolution: {integrity: sha512-/BpdSx+yCQGnCvecbyXdxHDkuk55/G3xwnC0GqY4gmQ3j+A+g8kzzgB4Nk/SINjqn6+waqw3EgbVF2QKExkRxQ==} - web-streams-polyfill@3.3.3: - resolution: {integrity: sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw==} - engines: {node: '>= 8'} - webidl-conversions@3.0.1: resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} @@ -4392,10 +4444,6 @@ packages: engines: {node: '>=8'} hasBin: true - winston-transport@4.7.1: - resolution: {integrity: sha512-wQCXXVgfv/wUPOfb2x0ruxzwkcZfxcktz6JIMUaPLmcNhO4bZTwA/WtDWK74xV3F2dKu8YadrFv0qhwYjVEwhA==} - engines: {node: '>= 12.0.0'} - winston-transport@4.9.0: resolution: {integrity: sha512-8drMJ4rkgaPo1Me4zD/3WLfI/zPdA9o2IipKODunnGDcuqbHwjsbB79ylv04LCGGzU0xQ6vTznOMpQGaLhhm6A==} engines: {node: '>= 12.0.0'} @@ -4522,121 +4570,120 @@ snapshots: command-exists: 1.2.9 semver: 7.6.3 - '@azure-tools/azure-http-specs@0.1.0-alpha.10(hxmxu44wsiwmqbpvyuomrsmujq)': + '@azure-tools/azure-http-specs@0.1.0-alpha.13-dev.1(dkz3jopup3kcww2tc3n27h5adi)': dependencies: - '@azure-tools/typespec-azure-core': 0.53.0(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))))(@typespec/rest@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))))) - '@typespec/compiler': 0.67.1(@types/node@22.5.5) - '@typespec/http': 0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))) - '@typespec/rest': 0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5)))) + '@azure-tools/typespec-azure-core': 0.54.0-dev.5(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))(@typespec/rest@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))) + '@typespec/compiler': 0.68.0-dev.12(@types/node@22.5.5) + '@typespec/http': 0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))) + '@typespec/rest': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)))) '@typespec/spec-api': 0.1.0-alpha.3-dev.0 - '@typespec/spector': 0.1.0-alpha.9(@types/node@22.5.5)(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))) - '@typespec/versioning': 0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5)) - '@typespec/xml': 0.59.0(@typespec/compiler@0.67.1(@types/node@22.5.5)) + '@typespec/spector': 0.1.0-alpha.10(@types/node@22.5.5)(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))) + '@typespec/versioning': 0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)) + '@typespec/xml': 0.59.0(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)) transitivePeerDependencies: - '@types/express' - '@types/node' - '@typespec/streams' - - debug - supports-color - '@azure-tools/typespec-autorest@0.53.0(e3cfoxkazmlklhsfsyiqwpleoq)': + '@azure-tools/typespec-autorest@0.54.0-dev.5(vbjiszjdl42dvuq2wpgzxde7nu)': dependencies: - '@azure-tools/typespec-azure-core': 0.53.0(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))))(@typespec/rest@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))))) - '@azure-tools/typespec-azure-resource-manager': 0.53.0(felt6lfzt5orrlwrzxpkykwppa) - '@azure-tools/typespec-client-generator-core': 0.53.1(3qm5ewpnxvwkav6ttg6x7temqm) - '@typespec/compiler': 0.67.1(@types/node@22.5.5) - '@typespec/http': 0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))) - '@typespec/openapi': 0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5)))) - '@typespec/rest': 0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5)))) - '@typespec/versioning': 0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5)) + '@azure-tools/typespec-azure-core': 0.54.0-dev.5(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))(@typespec/rest@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))) + '@azure-tools/typespec-azure-resource-manager': 0.54.0-dev.3(vvsjt7ss6dhpuzy2lahlecfu7a) + '@azure-tools/typespec-client-generator-core': 0.54.0-dev.17(bi3uo6v4m3cwrf7tvdzqjmlfka) + '@typespec/compiler': 0.68.0-dev.12(@types/node@22.5.5) + '@typespec/http': 0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))) + '@typespec/openapi': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)))) + '@typespec/rest': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)))) + '@typespec/versioning': 0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)) - '@azure-tools/typespec-autorest@0.53.0(wjegnqrrlroq36cedwihs7fwdy)': + '@azure-tools/typespec-autorest@0.54.0-dev.5(zatd3rwsnwvs4pr3qbbtcvlpxe)': dependencies: - '@azure-tools/typespec-azure-core': 0.53.0(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))))(@typespec/rest@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))))) - '@azure-tools/typespec-azure-resource-manager': 0.53.0(3gv5j4bbl2jtmj53euvpetu3oa) - '@azure-tools/typespec-client-generator-core': 0.53.1(vvgwrzozbt5d3w3ee557dp5xuy) - '@typespec/compiler': 0.67.1(@types/node@22.13.10) - '@typespec/http': 0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))) - '@typespec/openapi': 0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10)))) - '@typespec/rest': 0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10)))) - '@typespec/versioning': 0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10)) + '@azure-tools/typespec-azure-core': 0.54.0-dev.5(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))))(@typespec/rest@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))))) + '@azure-tools/typespec-azure-resource-manager': 0.54.0-dev.3(v3vj4toze5ay2f53uheih2fore) + '@azure-tools/typespec-client-generator-core': 0.54.0-dev.17(x4iqah4tm4sou6fo55o2ec4yze) + '@typespec/compiler': 0.68.0-dev.12(@types/node@22.13.10) + '@typespec/http': 0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))) + '@typespec/openapi': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10)))) + '@typespec/rest': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10)))) + '@typespec/versioning': 0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10)) - '@azure-tools/typespec-azure-core@0.53.0(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))))(@typespec/rest@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10)))))': + '@azure-tools/typespec-azure-core@0.54.0-dev.5(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))))(@typespec/rest@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10)))))': dependencies: - '@typespec/compiler': 0.67.1(@types/node@22.13.10) - '@typespec/http': 0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))) - '@typespec/rest': 0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10)))) + '@typespec/compiler': 0.68.0-dev.12(@types/node@22.13.10) + '@typespec/http': 0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))) + '@typespec/rest': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10)))) - '@azure-tools/typespec-azure-core@0.53.0(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))))(@typespec/rest@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5)))))': + '@azure-tools/typespec-azure-core@0.54.0-dev.5(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))(@typespec/rest@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)))))': dependencies: - '@typespec/compiler': 0.67.1(@types/node@22.5.5) - '@typespec/http': 0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))) - '@typespec/rest': 0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5)))) + '@typespec/compiler': 0.68.0-dev.12(@types/node@22.5.5) + '@typespec/http': 0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))) + '@typespec/rest': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)))) - '@azure-tools/typespec-azure-resource-manager@0.53.0(3gv5j4bbl2jtmj53euvpetu3oa)': + '@azure-tools/typespec-azure-resource-manager@0.54.0-dev.3(v3vj4toze5ay2f53uheih2fore)': dependencies: - '@azure-tools/typespec-azure-core': 0.53.0(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))))(@typespec/rest@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))))) - '@typespec/compiler': 0.67.1(@types/node@22.13.10) - '@typespec/http': 0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))) - '@typespec/openapi': 0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10)))) - '@typespec/rest': 0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10)))) - '@typespec/versioning': 0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10)) + '@azure-tools/typespec-azure-core': 0.54.0-dev.5(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))))(@typespec/rest@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))))) + '@typespec/compiler': 0.68.0-dev.12(@types/node@22.13.10) + '@typespec/http': 0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))) + '@typespec/openapi': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10)))) + '@typespec/rest': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10)))) + '@typespec/versioning': 0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10)) change-case: 5.4.4 pluralize: 8.0.0 - '@azure-tools/typespec-azure-resource-manager@0.53.0(felt6lfzt5orrlwrzxpkykwppa)': + '@azure-tools/typespec-azure-resource-manager@0.54.0-dev.3(vvsjt7ss6dhpuzy2lahlecfu7a)': dependencies: - '@azure-tools/typespec-azure-core': 0.53.0(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))))(@typespec/rest@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))))) - '@typespec/compiler': 0.67.1(@types/node@22.5.5) - '@typespec/http': 0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))) - '@typespec/openapi': 0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5)))) - '@typespec/rest': 0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5)))) - '@typespec/versioning': 0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5)) + '@azure-tools/typespec-azure-core': 0.54.0-dev.5(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))(@typespec/rest@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))) + '@typespec/compiler': 0.68.0-dev.12(@types/node@22.5.5) + '@typespec/http': 0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))) + '@typespec/openapi': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)))) + '@typespec/rest': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)))) + '@typespec/versioning': 0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)) change-case: 5.4.4 pluralize: 8.0.0 - '@azure-tools/typespec-azure-rulesets@0.53.0(@azure-tools/typespec-azure-core@0.53.0(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))))(@typespec/rest@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))))))(@azure-tools/typespec-azure-resource-manager@0.53.0(3gv5j4bbl2jtmj53euvpetu3oa))(@azure-tools/typespec-client-generator-core@0.53.1(vvgwrzozbt5d3w3ee557dp5xuy))(@typespec/compiler@0.67.1(@types/node@22.13.10))': + '@azure-tools/typespec-azure-rulesets@0.54.0-dev.2(@azure-tools/typespec-azure-core@0.54.0-dev.5(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))))(@typespec/rest@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))))))(@azure-tools/typespec-azure-resource-manager@0.54.0-dev.3(v3vj4toze5ay2f53uheih2fore))(@azure-tools/typespec-client-generator-core@0.54.0-dev.17(x4iqah4tm4sou6fo55o2ec4yze))(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))': dependencies: - '@azure-tools/typespec-azure-core': 0.53.0(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))))(@typespec/rest@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))))) - '@azure-tools/typespec-azure-resource-manager': 0.53.0(3gv5j4bbl2jtmj53euvpetu3oa) - '@azure-tools/typespec-client-generator-core': 0.53.1(vvgwrzozbt5d3w3ee557dp5xuy) - '@typespec/compiler': 0.67.1(@types/node@22.13.10) + '@azure-tools/typespec-azure-core': 0.54.0-dev.5(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))))(@typespec/rest@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))))) + '@azure-tools/typespec-azure-resource-manager': 0.54.0-dev.3(v3vj4toze5ay2f53uheih2fore) + '@azure-tools/typespec-client-generator-core': 0.54.0-dev.17(x4iqah4tm4sou6fo55o2ec4yze) + '@typespec/compiler': 0.68.0-dev.12(@types/node@22.13.10) - '@azure-tools/typespec-azure-rulesets@0.53.0(@azure-tools/typespec-azure-core@0.53.0(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))))(@typespec/rest@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))))))(@azure-tools/typespec-azure-resource-manager@0.53.0(felt6lfzt5orrlwrzxpkykwppa))(@azure-tools/typespec-client-generator-core@0.53.1(3qm5ewpnxvwkav6ttg6x7temqm))(@typespec/compiler@0.67.1(@types/node@22.5.5))': + '@azure-tools/typespec-azure-rulesets@0.54.0-dev.2(@azure-tools/typespec-azure-core@0.54.0-dev.5(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))(@typespec/rest@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))))(@azure-tools/typespec-azure-resource-manager@0.54.0-dev.3(vvsjt7ss6dhpuzy2lahlecfu7a))(@azure-tools/typespec-client-generator-core@0.54.0-dev.17(bi3uo6v4m3cwrf7tvdzqjmlfka))(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))': dependencies: - '@azure-tools/typespec-azure-core': 0.53.0(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))))(@typespec/rest@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))))) - '@azure-tools/typespec-azure-resource-manager': 0.53.0(felt6lfzt5orrlwrzxpkykwppa) - '@azure-tools/typespec-client-generator-core': 0.53.1(3qm5ewpnxvwkav6ttg6x7temqm) - '@typespec/compiler': 0.67.1(@types/node@22.5.5) + '@azure-tools/typespec-azure-core': 0.54.0-dev.5(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))(@typespec/rest@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))) + '@azure-tools/typespec-azure-resource-manager': 0.54.0-dev.3(vvsjt7ss6dhpuzy2lahlecfu7a) + '@azure-tools/typespec-client-generator-core': 0.54.0-dev.17(bi3uo6v4m3cwrf7tvdzqjmlfka) + '@typespec/compiler': 0.68.0-dev.12(@types/node@22.5.5) - '@azure-tools/typespec-client-generator-core@0.53.1(3qm5ewpnxvwkav6ttg6x7temqm)': + '@azure-tools/typespec-client-generator-core@0.54.0-dev.17(bi3uo6v4m3cwrf7tvdzqjmlfka)': dependencies: - '@azure-tools/typespec-azure-core': 0.53.0(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))))(@typespec/rest@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))))) - '@typespec/compiler': 0.67.1(@types/node@22.5.5) - '@typespec/events': 0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5)) - '@typespec/http': 0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))) - '@typespec/openapi': 0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5)))) - '@typespec/rest': 0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5)))) - '@typespec/sse': 0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/events@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5)))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))) - '@typespec/streams': 0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5)) - '@typespec/versioning': 0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5)) - '@typespec/xml': 0.59.0(@typespec/compiler@0.67.1(@types/node@22.5.5)) + '@azure-tools/typespec-azure-core': 0.54.0-dev.5(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))(@typespec/rest@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))) + '@typespec/compiler': 0.68.0-dev.12(@types/node@22.5.5) + '@typespec/events': 0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)) + '@typespec/http': 0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))) + '@typespec/openapi': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)))) + '@typespec/rest': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)))) + '@typespec/sse': 0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/events@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))) + '@typespec/streams': 0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)) + '@typespec/versioning': 0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)) + '@typespec/xml': 0.59.0(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)) change-case: 5.4.4 pluralize: 8.0.0 yaml: 2.7.0 - '@azure-tools/typespec-client-generator-core@0.53.1(vvgwrzozbt5d3w3ee557dp5xuy)': - dependencies: - '@azure-tools/typespec-azure-core': 0.53.0(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))))(@typespec/rest@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))))) - '@typespec/compiler': 0.67.1(@types/node@22.13.10) - '@typespec/events': 0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10)) - '@typespec/http': 0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))) - '@typespec/openapi': 0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10)))) - '@typespec/rest': 0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10)))) - '@typespec/sse': 0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/events@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10)))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))) - '@typespec/streams': 0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10)) - '@typespec/versioning': 0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10)) - '@typespec/xml': 0.59.0(@typespec/compiler@0.67.1(@types/node@22.13.10)) + '@azure-tools/typespec-client-generator-core@0.54.0-dev.17(x4iqah4tm4sou6fo55o2ec4yze)': + dependencies: + '@azure-tools/typespec-azure-core': 0.54.0-dev.5(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))))(@typespec/rest@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))))) + '@typespec/compiler': 0.68.0-dev.12(@types/node@22.13.10) + '@typespec/events': 0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10)) + '@typespec/http': 0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))) + '@typespec/openapi': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10)))) + '@typespec/rest': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10)))) + '@typespec/sse': 0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/events@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10)))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))) + '@typespec/streams': 0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10)) + '@typespec/versioning': 0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10)) + '@typespec/xml': 0.59.0(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10)) change-case: 5.4.4 pluralize: 8.0.0 yaml: 2.7.0 @@ -4645,12 +4692,6 @@ snapshots: dependencies: tslib: 2.7.0 - '@azure/core-auth@1.8.0': - dependencies: - '@azure/abort-controller': 2.1.2 - '@azure/core-util': 1.11.0 - tslib: 2.7.0 - '@azure/core-auth@1.9.0': dependencies: '@azure/abort-controller': 2.1.2 @@ -4705,11 +4746,6 @@ snapshots: dependencies: tslib: 2.7.0 - '@azure/core-util@1.10.0': - dependencies: - '@azure/abort-controller': 2.1.2 - tslib: 2.7.0 - '@azure/core-util@1.11.0': dependencies: '@azure/abort-controller': 2.1.2 @@ -4739,6 +4775,25 @@ snapshots: transitivePeerDependencies: - supports-color + '@azure/identity@4.8.0': + dependencies: + '@azure/abort-controller': 2.1.2 + '@azure/core-auth': 1.9.0 + '@azure/core-client': 1.9.2 + '@azure/core-rest-pipeline': 1.17.0 + '@azure/core-tracing': 1.1.2 + '@azure/core-util': 1.11.0 + '@azure/logger': 1.1.4 + '@azure/msal-browser': 4.5.1 + '@azure/msal-node': 3.3.0 + events: 3.3.0 + jws: 4.0.0 + open: 10.1.0 + stoppable: 1.1.0 + tslib: 2.7.0 + transitivePeerDependencies: + - supports-color + '@azure/logger@1.1.4': dependencies: tslib: 2.7.0 @@ -4760,14 +4815,14 @@ snapshots: '@azure/storage-blob@12.25.0': dependencies: '@azure/abort-controller': 2.1.2 - '@azure/core-auth': 1.8.0 + '@azure/core-auth': 1.9.0 '@azure/core-client': 1.9.2 '@azure/core-http-compat': 2.1.2 '@azure/core-lro': 2.7.2 '@azure/core-paging': 1.6.2 '@azure/core-rest-pipeline': 1.17.0 '@azure/core-tracing': 1.1.2 - '@azure/core-util': 1.10.0 + '@azure/core-util': 1.11.0 '@azure/core-xml': 1.4.3 '@azure/logger': 1.1.4 events: 3.3.0 @@ -4793,11 +4848,6 @@ snapshots: transitivePeerDependencies: - supports-color - '@babel/code-frame@7.24.7': - dependencies: - '@babel/highlight': 7.24.7 - picocolors: 1.1.1 - '@babel/code-frame@7.26.2': dependencies: '@babel/helper-validator-identifier': 7.25.9 @@ -4808,13 +4858,6 @@ snapshots: '@babel/helper-validator-identifier@7.25.9': {} - '@babel/highlight@7.24.7': - dependencies: - '@babel/helper-validator-identifier': 7.25.9 - chalk: 2.4.2 - js-tokens: 4.0.0 - picocolors: 1.1.1 - '@bcoe/v8-coverage@1.0.2': {} '@chronus/chronus@0.12.1': @@ -5247,16 +5290,6 @@ snapshots: '@humanwhocodes/retry@0.3.0': {} - '@inquirer/checkbox@4.1.2(@types/node@22.13.10)': - dependencies: - '@inquirer/core': 10.1.7(@types/node@22.13.10) - '@inquirer/figures': 1.0.10 - '@inquirer/type': 3.0.4(@types/node@22.13.10) - ansi-escapes: 4.3.2 - yoctocolors-cjs: 2.1.2 - optionalDependencies: - '@types/node': 22.13.10 - '@inquirer/checkbox@4.1.2(@types/node@22.5.5)': dependencies: '@inquirer/core': 10.1.7(@types/node@22.5.5) @@ -5267,13 +5300,26 @@ snapshots: optionalDependencies: '@types/node': 22.5.5 - '@inquirer/confirm@5.1.6(@types/node@22.13.10)': + '@inquirer/checkbox@4.1.4(@types/node@22.13.10)': dependencies: - '@inquirer/core': 10.1.7(@types/node@22.13.10) - '@inquirer/type': 3.0.4(@types/node@22.13.10) + '@inquirer/core': 10.1.9(@types/node@22.13.10) + '@inquirer/figures': 1.0.11 + '@inquirer/type': 3.0.5(@types/node@22.13.10) + ansi-escapes: 4.3.2 + yoctocolors-cjs: 2.1.2 optionalDependencies: '@types/node': 22.13.10 + '@inquirer/checkbox@4.1.4(@types/node@22.5.5)': + dependencies: + '@inquirer/core': 10.1.9(@types/node@22.5.5) + '@inquirer/figures': 1.0.11 + '@inquirer/type': 3.0.5(@types/node@22.5.5) + ansi-escapes: 4.3.2 + yoctocolors-cjs: 2.1.2 + optionalDependencies: + '@types/node': 22.5.5 + '@inquirer/confirm@5.1.6(@types/node@22.5.5)': dependencies: '@inquirer/core': 10.1.7(@types/node@22.5.5) @@ -5281,10 +5327,37 @@ snapshots: optionalDependencies: '@types/node': 22.5.5 - '@inquirer/core@10.1.7(@types/node@22.13.10)': + '@inquirer/confirm@5.1.8(@types/node@22.13.10)': + dependencies: + '@inquirer/core': 10.1.9(@types/node@22.13.10) + '@inquirer/type': 3.0.5(@types/node@22.13.10) + optionalDependencies: + '@types/node': 22.13.10 + + '@inquirer/confirm@5.1.8(@types/node@22.5.5)': + dependencies: + '@inquirer/core': 10.1.9(@types/node@22.5.5) + '@inquirer/type': 3.0.5(@types/node@22.5.5) + optionalDependencies: + '@types/node': 22.5.5 + + '@inquirer/core@10.1.7(@types/node@22.5.5)': dependencies: '@inquirer/figures': 1.0.10 - '@inquirer/type': 3.0.4(@types/node@22.13.10) + '@inquirer/type': 3.0.4(@types/node@22.5.5) + ansi-escapes: 4.3.2 + cli-width: 4.1.0 + mute-stream: 2.0.0 + signal-exit: 4.1.0 + wrap-ansi: 6.2.0 + yoctocolors-cjs: 2.1.2 + optionalDependencies: + '@types/node': 22.5.5 + + '@inquirer/core@10.1.9(@types/node@22.13.10)': + dependencies: + '@inquirer/figures': 1.0.11 + '@inquirer/type': 3.0.5(@types/node@22.13.10) ansi-escapes: 4.3.2 cli-width: 4.1.0 mute-stream: 2.0.0 @@ -5294,10 +5367,10 @@ snapshots: optionalDependencies: '@types/node': 22.13.10 - '@inquirer/core@10.1.7(@types/node@22.5.5)': + '@inquirer/core@10.1.9(@types/node@22.5.5)': dependencies: - '@inquirer/figures': 1.0.10 - '@inquirer/type': 3.0.4(@types/node@22.5.5) + '@inquirer/figures': 1.0.11 + '@inquirer/type': 3.0.5(@types/node@22.5.5) ansi-escapes: 4.3.2 cli-width: 4.1.0 mute-stream: 2.0.0 @@ -5307,30 +5380,46 @@ snapshots: optionalDependencies: '@types/node': 22.5.5 - '@inquirer/editor@4.2.7(@types/node@22.13.10)': + '@inquirer/editor@4.2.7(@types/node@22.5.5)': + dependencies: + '@inquirer/core': 10.1.7(@types/node@22.5.5) + '@inquirer/type': 3.0.4(@types/node@22.5.5) + external-editor: 3.1.0 + optionalDependencies: + '@types/node': 22.5.5 + + '@inquirer/editor@4.2.9(@types/node@22.13.10)': dependencies: - '@inquirer/core': 10.1.7(@types/node@22.13.10) - '@inquirer/type': 3.0.4(@types/node@22.13.10) + '@inquirer/core': 10.1.9(@types/node@22.13.10) + '@inquirer/type': 3.0.5(@types/node@22.13.10) external-editor: 3.1.0 optionalDependencies: '@types/node': 22.13.10 - '@inquirer/editor@4.2.7(@types/node@22.5.5)': + '@inquirer/editor@4.2.9(@types/node@22.5.5)': dependencies: - '@inquirer/core': 10.1.7(@types/node@22.5.5) - '@inquirer/type': 3.0.4(@types/node@22.5.5) + '@inquirer/core': 10.1.9(@types/node@22.5.5) + '@inquirer/type': 3.0.5(@types/node@22.5.5) external-editor: 3.1.0 optionalDependencies: '@types/node': 22.5.5 - '@inquirer/expand@4.0.9(@types/node@22.13.10)': + '@inquirer/expand@4.0.11(@types/node@22.13.10)': dependencies: - '@inquirer/core': 10.1.7(@types/node@22.13.10) - '@inquirer/type': 3.0.4(@types/node@22.13.10) + '@inquirer/core': 10.1.9(@types/node@22.13.10) + '@inquirer/type': 3.0.5(@types/node@22.13.10) yoctocolors-cjs: 2.1.2 optionalDependencies: '@types/node': 22.13.10 + '@inquirer/expand@4.0.11(@types/node@22.5.5)': + dependencies: + '@inquirer/core': 10.1.9(@types/node@22.5.5) + '@inquirer/type': 3.0.5(@types/node@22.5.5) + yoctocolors-cjs: 2.1.2 + optionalDependencies: + '@types/node': 22.5.5 + '@inquirer/expand@4.0.9(@types/node@22.5.5)': dependencies: '@inquirer/core': 10.1.7(@types/node@22.5.5) @@ -5341,12 +5430,7 @@ snapshots: '@inquirer/figures@1.0.10': {} - '@inquirer/input@4.1.6(@types/node@22.13.10)': - dependencies: - '@inquirer/core': 10.1.7(@types/node@22.13.10) - '@inquirer/type': 3.0.4(@types/node@22.13.10) - optionalDependencies: - '@types/node': 22.13.10 + '@inquirer/figures@1.0.11': {} '@inquirer/input@4.1.6(@types/node@22.5.5)': dependencies: @@ -5355,13 +5439,34 @@ snapshots: optionalDependencies: '@types/node': 22.5.5 - '@inquirer/number@3.0.9(@types/node@22.13.10)': + '@inquirer/input@4.1.8(@types/node@22.13.10)': dependencies: - '@inquirer/core': 10.1.7(@types/node@22.13.10) - '@inquirer/type': 3.0.4(@types/node@22.13.10) + '@inquirer/core': 10.1.9(@types/node@22.13.10) + '@inquirer/type': 3.0.5(@types/node@22.13.10) optionalDependencies: '@types/node': 22.13.10 + '@inquirer/input@4.1.8(@types/node@22.5.5)': + dependencies: + '@inquirer/core': 10.1.9(@types/node@22.5.5) + '@inquirer/type': 3.0.5(@types/node@22.5.5) + optionalDependencies: + '@types/node': 22.5.5 + + '@inquirer/number@3.0.11(@types/node@22.13.10)': + dependencies: + '@inquirer/core': 10.1.9(@types/node@22.13.10) + '@inquirer/type': 3.0.5(@types/node@22.13.10) + optionalDependencies: + '@types/node': 22.13.10 + + '@inquirer/number@3.0.11(@types/node@22.5.5)': + dependencies: + '@inquirer/core': 10.1.9(@types/node@22.5.5) + '@inquirer/type': 3.0.5(@types/node@22.5.5) + optionalDependencies: + '@types/node': 22.5.5 + '@inquirer/number@3.0.9(@types/node@22.5.5)': dependencies: '@inquirer/core': 10.1.7(@types/node@22.5.5) @@ -5369,14 +5474,22 @@ snapshots: optionalDependencies: '@types/node': 22.5.5 - '@inquirer/password@4.0.9(@types/node@22.13.10)': + '@inquirer/password@4.0.11(@types/node@22.13.10)': dependencies: - '@inquirer/core': 10.1.7(@types/node@22.13.10) - '@inquirer/type': 3.0.4(@types/node@22.13.10) + '@inquirer/core': 10.1.9(@types/node@22.13.10) + '@inquirer/type': 3.0.5(@types/node@22.13.10) ansi-escapes: 4.3.2 optionalDependencies: '@types/node': 22.13.10 + '@inquirer/password@4.0.11(@types/node@22.5.5)': + dependencies: + '@inquirer/core': 10.1.9(@types/node@22.5.5) + '@inquirer/type': 3.0.5(@types/node@22.5.5) + ansi-escapes: 4.3.2 + optionalDependencies: + '@types/node': 22.5.5 + '@inquirer/password@4.0.9(@types/node@22.5.5)': dependencies: '@inquirer/core': 10.1.7(@types/node@22.5.5) @@ -5385,21 +5498,6 @@ snapshots: optionalDependencies: '@types/node': 22.5.5 - '@inquirer/prompts@7.3.2(@types/node@22.13.10)': - dependencies: - '@inquirer/checkbox': 4.1.2(@types/node@22.13.10) - '@inquirer/confirm': 5.1.6(@types/node@22.13.10) - '@inquirer/editor': 4.2.7(@types/node@22.13.10) - '@inquirer/expand': 4.0.9(@types/node@22.13.10) - '@inquirer/input': 4.1.6(@types/node@22.13.10) - '@inquirer/number': 3.0.9(@types/node@22.13.10) - '@inquirer/password': 4.0.9(@types/node@22.13.10) - '@inquirer/rawlist': 4.0.9(@types/node@22.13.10) - '@inquirer/search': 3.0.9(@types/node@22.13.10) - '@inquirer/select': 4.0.9(@types/node@22.13.10) - optionalDependencies: - '@types/node': 22.13.10 - '@inquirer/prompts@7.3.2(@types/node@22.5.5)': dependencies: '@inquirer/checkbox': 4.1.2(@types/node@22.5.5) @@ -5415,14 +5513,52 @@ snapshots: optionalDependencies: '@types/node': 22.5.5 - '@inquirer/rawlist@4.0.9(@types/node@22.13.10)': + '@inquirer/prompts@7.4.0(@types/node@22.13.10)': + dependencies: + '@inquirer/checkbox': 4.1.4(@types/node@22.13.10) + '@inquirer/confirm': 5.1.8(@types/node@22.13.10) + '@inquirer/editor': 4.2.9(@types/node@22.13.10) + '@inquirer/expand': 4.0.11(@types/node@22.13.10) + '@inquirer/input': 4.1.8(@types/node@22.13.10) + '@inquirer/number': 3.0.11(@types/node@22.13.10) + '@inquirer/password': 4.0.11(@types/node@22.13.10) + '@inquirer/rawlist': 4.0.11(@types/node@22.13.10) + '@inquirer/search': 3.0.11(@types/node@22.13.10) + '@inquirer/select': 4.1.0(@types/node@22.13.10) + optionalDependencies: + '@types/node': 22.13.10 + + '@inquirer/prompts@7.4.0(@types/node@22.5.5)': + dependencies: + '@inquirer/checkbox': 4.1.4(@types/node@22.5.5) + '@inquirer/confirm': 5.1.8(@types/node@22.5.5) + '@inquirer/editor': 4.2.9(@types/node@22.5.5) + '@inquirer/expand': 4.0.11(@types/node@22.5.5) + '@inquirer/input': 4.1.8(@types/node@22.5.5) + '@inquirer/number': 3.0.11(@types/node@22.5.5) + '@inquirer/password': 4.0.11(@types/node@22.5.5) + '@inquirer/rawlist': 4.0.11(@types/node@22.5.5) + '@inquirer/search': 3.0.11(@types/node@22.5.5) + '@inquirer/select': 4.1.0(@types/node@22.5.5) + optionalDependencies: + '@types/node': 22.5.5 + + '@inquirer/rawlist@4.0.11(@types/node@22.13.10)': dependencies: - '@inquirer/core': 10.1.7(@types/node@22.13.10) - '@inquirer/type': 3.0.4(@types/node@22.13.10) + '@inquirer/core': 10.1.9(@types/node@22.13.10) + '@inquirer/type': 3.0.5(@types/node@22.13.10) yoctocolors-cjs: 2.1.2 optionalDependencies: '@types/node': 22.13.10 + '@inquirer/rawlist@4.0.11(@types/node@22.5.5)': + dependencies: + '@inquirer/core': 10.1.9(@types/node@22.5.5) + '@inquirer/type': 3.0.5(@types/node@22.5.5) + yoctocolors-cjs: 2.1.2 + optionalDependencies: + '@types/node': 22.5.5 + '@inquirer/rawlist@4.0.9(@types/node@22.5.5)': dependencies: '@inquirer/core': 10.1.7(@types/node@22.5.5) @@ -5431,15 +5567,24 @@ snapshots: optionalDependencies: '@types/node': 22.5.5 - '@inquirer/search@3.0.9(@types/node@22.13.10)': + '@inquirer/search@3.0.11(@types/node@22.13.10)': dependencies: - '@inquirer/core': 10.1.7(@types/node@22.13.10) - '@inquirer/figures': 1.0.10 - '@inquirer/type': 3.0.4(@types/node@22.13.10) + '@inquirer/core': 10.1.9(@types/node@22.13.10) + '@inquirer/figures': 1.0.11 + '@inquirer/type': 3.0.5(@types/node@22.13.10) yoctocolors-cjs: 2.1.2 optionalDependencies: '@types/node': 22.13.10 + '@inquirer/search@3.0.11(@types/node@22.5.5)': + dependencies: + '@inquirer/core': 10.1.9(@types/node@22.5.5) + '@inquirer/figures': 1.0.11 + '@inquirer/type': 3.0.5(@types/node@22.5.5) + yoctocolors-cjs: 2.1.2 + optionalDependencies: + '@types/node': 22.5.5 + '@inquirer/search@3.0.9(@types/node@22.5.5)': dependencies: '@inquirer/core': 10.1.7(@types/node@22.5.5) @@ -5449,31 +5594,45 @@ snapshots: optionalDependencies: '@types/node': 22.5.5 - '@inquirer/select@4.0.9(@types/node@22.13.10)': + '@inquirer/select@4.0.9(@types/node@22.5.5)': dependencies: - '@inquirer/core': 10.1.7(@types/node@22.13.10) + '@inquirer/core': 10.1.7(@types/node@22.5.5) '@inquirer/figures': 1.0.10 - '@inquirer/type': 3.0.4(@types/node@22.13.10) + '@inquirer/type': 3.0.4(@types/node@22.5.5) + ansi-escapes: 4.3.2 + yoctocolors-cjs: 2.1.2 + optionalDependencies: + '@types/node': 22.5.5 + + '@inquirer/select@4.1.0(@types/node@22.13.10)': + dependencies: + '@inquirer/core': 10.1.9(@types/node@22.13.10) + '@inquirer/figures': 1.0.11 + '@inquirer/type': 3.0.5(@types/node@22.13.10) ansi-escapes: 4.3.2 yoctocolors-cjs: 2.1.2 optionalDependencies: '@types/node': 22.13.10 - '@inquirer/select@4.0.9(@types/node@22.5.5)': + '@inquirer/select@4.1.0(@types/node@22.5.5)': dependencies: - '@inquirer/core': 10.1.7(@types/node@22.5.5) - '@inquirer/figures': 1.0.10 - '@inquirer/type': 3.0.4(@types/node@22.5.5) + '@inquirer/core': 10.1.9(@types/node@22.5.5) + '@inquirer/figures': 1.0.11 + '@inquirer/type': 3.0.5(@types/node@22.5.5) ansi-escapes: 4.3.2 yoctocolors-cjs: 2.1.2 optionalDependencies: '@types/node': 22.5.5 - '@inquirer/type@3.0.4(@types/node@22.13.10)': + '@inquirer/type@3.0.4(@types/node@22.5.5)': + optionalDependencies: + '@types/node': 22.5.5 + + '@inquirer/type@3.0.5(@types/node@22.13.10)': optionalDependencies: '@types/node': 22.13.10 - '@inquirer/type@3.0.4(@types/node@22.5.5)': + '@inquirer/type@3.0.5(@types/node@22.5.5)': optionalDependencies: '@types/node': 22.5.5 @@ -6104,10 +6263,10 @@ snapshots: '@typescript-eslint/types': 8.7.0 eslint-visitor-keys: 3.4.3 - '@typespec/compiler@0.67.1(@types/node@22.13.10)': + '@typespec/compiler@0.67.2(@types/node@22.5.5)': dependencies: '@babel/code-frame': 7.26.2 - '@inquirer/prompts': 7.3.2(@types/node@22.13.10) + '@inquirer/prompts': 7.3.2(@types/node@22.5.5) ajv: 8.17.1 change-case: 5.4.4 env-paths: 3.0.0 @@ -6126,10 +6285,10 @@ snapshots: transitivePeerDependencies: - '@types/node' - '@typespec/compiler@0.67.1(@types/node@22.5.5)': + '@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10)': dependencies: '@babel/code-frame': 7.26.2 - '@inquirer/prompts': 7.3.2(@types/node@22.5.5) + '@inquirer/prompts': 7.4.0(@types/node@22.13.10) ajv: 8.17.1 change-case: 5.4.4 env-paths: 3.0.0 @@ -6148,29 +6307,51 @@ snapshots: transitivePeerDependencies: - '@types/node' - '@typespec/events@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))': + '@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)': dependencies: - '@typespec/compiler': 0.67.1(@types/node@22.13.10) + '@babel/code-frame': 7.26.2 + '@inquirer/prompts': 7.4.0(@types/node@22.5.5) + ajv: 8.17.1 + change-case: 5.4.4 + env-paths: 3.0.0 + globby: 14.1.0 + is-unicode-supported: 2.1.0 + mustache: 4.2.0 + picocolors: 1.1.1 + prettier: 3.5.3 + semver: 7.7.1 + tar: 7.4.3 + temporal-polyfill: 0.2.5 + vscode-languageserver: 9.0.1 + vscode-languageserver-textdocument: 1.0.12 + yaml: 2.7.0 + yargs: 17.7.2 + transitivePeerDependencies: + - '@types/node' - '@typespec/events@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))': + '@typespec/events@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))': dependencies: - '@typespec/compiler': 0.67.1(@types/node@22.5.5) + '@typespec/compiler': 0.68.0-dev.12(@types/node@22.13.10) - '@typespec/http-client-python@0.8.3-dev.2(c25h2yeksuorzcqz3v4sac5zy4)': + '@typespec/events@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))': dependencies: - '@azure-tools/typespec-autorest': 0.53.0(wjegnqrrlroq36cedwihs7fwdy) - '@azure-tools/typespec-azure-core': 0.53.0(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))))(@typespec/rest@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))))) - '@azure-tools/typespec-azure-resource-manager': 0.53.0(3gv5j4bbl2jtmj53euvpetu3oa) - '@azure-tools/typespec-azure-rulesets': 0.53.0(@azure-tools/typespec-azure-core@0.53.0(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))))(@typespec/rest@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))))))(@azure-tools/typespec-azure-resource-manager@0.53.0(3gv5j4bbl2jtmj53euvpetu3oa))(@azure-tools/typespec-client-generator-core@0.53.1(vvgwrzozbt5d3w3ee557dp5xuy))(@typespec/compiler@0.67.1(@types/node@22.13.10)) - '@azure-tools/typespec-client-generator-core': 0.53.1(vvgwrzozbt5d3w3ee557dp5xuy) - '@typespec/compiler': 0.67.1(@types/node@22.13.10) - '@typespec/events': 0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10)) - '@typespec/http': 0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))) - '@typespec/openapi': 0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10)))) - '@typespec/rest': 0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10)))) - '@typespec/sse': 0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/events@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10)))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))) - '@typespec/streams': 0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10)) - '@typespec/versioning': 0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10)) + '@typespec/compiler': 0.68.0-dev.12(@types/node@22.5.5) + + '@typespec/http-client-python@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcwNTAzNi9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.2.tgz(iqakddphdaprnwwnwak65rubwq)': + dependencies: + '@azure-tools/typespec-autorest': 0.54.0-dev.5(zatd3rwsnwvs4pr3qbbtcvlpxe) + '@azure-tools/typespec-azure-core': 0.54.0-dev.5(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))))(@typespec/rest@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))))) + '@azure-tools/typespec-azure-resource-manager': 0.54.0-dev.3(v3vj4toze5ay2f53uheih2fore) + '@azure-tools/typespec-azure-rulesets': 0.54.0-dev.2(@azure-tools/typespec-azure-core@0.54.0-dev.5(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))))(@typespec/rest@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))))))(@azure-tools/typespec-azure-resource-manager@0.54.0-dev.3(v3vj4toze5ay2f53uheih2fore))(@azure-tools/typespec-client-generator-core@0.54.0-dev.17(x4iqah4tm4sou6fo55o2ec4yze))(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10)) + '@azure-tools/typespec-client-generator-core': 0.54.0-dev.17(x4iqah4tm4sou6fo55o2ec4yze) + '@typespec/compiler': 0.68.0-dev.12(@types/node@22.13.10) + '@typespec/events': 0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10)) + '@typespec/http': 0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))) + '@typespec/openapi': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10)))) + '@typespec/rest': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10)))) + '@typespec/sse': 0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/events@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10)))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))) + '@typespec/streams': 0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10)) + '@typespec/versioning': 0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10)) js-yaml: 4.1.0 marked: 15.0.7 pyodide: 0.26.2 @@ -6180,21 +6361,21 @@ snapshots: - bufferutil - utf-8-validate - '@typespec/http-client-python@0.8.3-dev.2(kvm224o5qzo556uchxhfoioziu)': - dependencies: - '@azure-tools/typespec-autorest': 0.53.0(e3cfoxkazmlklhsfsyiqwpleoq) - '@azure-tools/typespec-azure-core': 0.53.0(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))))(@typespec/rest@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))))) - '@azure-tools/typespec-azure-resource-manager': 0.53.0(felt6lfzt5orrlwrzxpkykwppa) - '@azure-tools/typespec-azure-rulesets': 0.53.0(@azure-tools/typespec-azure-core@0.53.0(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))))(@typespec/rest@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))))))(@azure-tools/typespec-azure-resource-manager@0.53.0(felt6lfzt5orrlwrzxpkykwppa))(@azure-tools/typespec-client-generator-core@0.53.1(3qm5ewpnxvwkav6ttg6x7temqm))(@typespec/compiler@0.67.1(@types/node@22.5.5)) - '@azure-tools/typespec-client-generator-core': 0.53.1(3qm5ewpnxvwkav6ttg6x7temqm) - '@typespec/compiler': 0.67.1(@types/node@22.5.5) - '@typespec/events': 0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5)) - '@typespec/http': 0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))) - '@typespec/openapi': 0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5)))) - '@typespec/rest': 0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5)))) - '@typespec/sse': 0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/events@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5)))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))) - '@typespec/streams': 0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5)) - '@typespec/versioning': 0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5)) + '@typespec/http-client-python@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcwNTAzNi9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.2.tgz(iutp5t4avvqu5ejcubt66dygha)': + dependencies: + '@azure-tools/typespec-autorest': 0.54.0-dev.5(vbjiszjdl42dvuq2wpgzxde7nu) + '@azure-tools/typespec-azure-core': 0.54.0-dev.5(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))(@typespec/rest@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))) + '@azure-tools/typespec-azure-resource-manager': 0.54.0-dev.3(vvsjt7ss6dhpuzy2lahlecfu7a) + '@azure-tools/typespec-azure-rulesets': 0.54.0-dev.2(@azure-tools/typespec-azure-core@0.54.0-dev.5(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))(@typespec/rest@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))))(@azure-tools/typespec-azure-resource-manager@0.54.0-dev.3(vvsjt7ss6dhpuzy2lahlecfu7a))(@azure-tools/typespec-client-generator-core@0.54.0-dev.17(bi3uo6v4m3cwrf7tvdzqjmlfka))(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)) + '@azure-tools/typespec-client-generator-core': 0.54.0-dev.17(bi3uo6v4m3cwrf7tvdzqjmlfka) + '@typespec/compiler': 0.68.0-dev.12(@types/node@22.5.5) + '@typespec/events': 0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)) + '@typespec/http': 0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))) + '@typespec/openapi': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)))) + '@typespec/rest': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)))) + '@typespec/sse': 0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/events@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))) + '@typespec/streams': 0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)) + '@typespec/versioning': 0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)) js-yaml: 4.1.0 marked: 15.0.7 pyodide: 0.26.2 @@ -6204,53 +6385,64 @@ snapshots: - bufferutil - utf-8-validate - '@typespec/http-specs@0.1.0-alpha.15-dev.3(@types/node@22.5.5)(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))))(@typespec/rest@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5)))))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5)))(@typespec/versioning@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5)))(@typespec/xml@0.59.0(@typespec/compiler@0.67.1(@types/node@22.5.5)))': + '@typespec/http-specs@0.1.0-alpha.17-dev.1(@types/node@22.5.5)(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))(@typespec/rest@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)))))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)))(@typespec/versioning@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)))(@typespec/xml@0.59.0(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)))': dependencies: - '@typespec/compiler': 0.67.1(@types/node@22.5.5) - '@typespec/http': 0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))) - '@typespec/rest': 0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5)))) + '@typespec/compiler': 0.68.0-dev.12(@types/node@22.5.5) + '@typespec/http': 0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))) + '@typespec/rest': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)))) '@typespec/spec-api': 0.1.0-alpha.3-dev.0 - '@typespec/spector': 0.1.0-alpha.9(@types/node@22.5.5)(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))) - '@typespec/versioning': 0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5)) - '@typespec/xml': 0.59.0(@typespec/compiler@0.67.1(@types/node@22.5.5)) + '@typespec/spector': 0.1.0-alpha.10(@types/node@22.5.5)(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))) + '@typespec/versioning': 0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)) + '@typespec/xml': 0.59.0(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)) + deep-equal: 2.2.3 transitivePeerDependencies: - '@types/express' - '@types/node' - '@typespec/streams' - - debug - supports-color - '@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10)))': + '@typespec/http@0.67.1(@typespec/compiler@0.67.2(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)))': dependencies: - '@typespec/compiler': 0.67.1(@types/node@22.13.10) + '@typespec/compiler': 0.67.2(@types/node@22.5.5) optionalDependencies: - '@typespec/streams': 0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10)) + '@typespec/streams': 0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)) - '@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5)))': + '@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10)))': dependencies: - '@typespec/compiler': 0.67.1(@types/node@22.5.5) + '@typespec/compiler': 0.68.0-dev.12(@types/node@22.13.10) optionalDependencies: - '@typespec/streams': 0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5)) + '@typespec/streams': 0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10)) + + '@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)))': + dependencies: + '@typespec/compiler': 0.68.0-dev.12(@types/node@22.5.5) + optionalDependencies: + '@typespec/streams': 0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)) + + '@typespec/openapi@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))))': + dependencies: + '@typespec/compiler': 0.68.0-dev.12(@types/node@22.13.10) + '@typespec/http': 0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))) - '@typespec/openapi@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))))': + '@typespec/openapi@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))': dependencies: - '@typespec/compiler': 0.67.1(@types/node@22.13.10) - '@typespec/http': 0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))) + '@typespec/compiler': 0.68.0-dev.12(@types/node@22.5.5) + '@typespec/http': 0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))) - '@typespec/openapi@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))))': + '@typespec/rest@0.67.1(@typespec/compiler@0.67.2(@types/node@22.5.5))(@typespec/http@0.67.1(@typespec/compiler@0.67.2(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))': dependencies: - '@typespec/compiler': 0.67.1(@types/node@22.5.5) - '@typespec/http': 0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))) + '@typespec/compiler': 0.67.2(@types/node@22.5.5) + '@typespec/http': 0.67.1(@typespec/compiler@0.67.2(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))) - '@typespec/rest@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))))': + '@typespec/rest@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))))': dependencies: - '@typespec/compiler': 0.67.1(@types/node@22.13.10) - '@typespec/http': 0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))) + '@typespec/compiler': 0.68.0-dev.12(@types/node@22.13.10) + '@typespec/http': 0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))) - '@typespec/rest@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))))': + '@typespec/rest@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))': dependencies: - '@typespec/compiler': 0.67.1(@types/node@22.5.5) - '@typespec/http': 0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))) + '@typespec/compiler': 0.68.0-dev.12(@types/node@22.5.5) + '@typespec/http': 0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))) '@typespec/spec-api@0.1.0-alpha.3-dev.0': dependencies: @@ -6277,78 +6469,76 @@ snapshots: transitivePeerDependencies: - supports-color - '@typespec/spector@0.1.0-alpha.9(@types/node@22.5.5)(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5)))': + '@typespec/spector@0.1.0-alpha.10(@types/node@22.5.5)(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)))': dependencies: - '@azure/identity': 4.7.0 + '@azure/identity': 4.8.0 '@types/js-yaml': 4.0.9 - '@typespec/compiler': 0.67.1(@types/node@22.5.5) - '@typespec/http': 0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))) - '@typespec/rest': 0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5)))) + '@typespec/compiler': 0.67.2(@types/node@22.5.5) + '@typespec/http': 0.67.1(@typespec/compiler@0.67.2(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))) + '@typespec/rest': 0.67.1(@typespec/compiler@0.67.2(@types/node@22.5.5))(@typespec/http@0.67.1(@typespec/compiler@0.67.2(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)))) '@typespec/spec-api': 0.1.0-alpha.3-dev.0 '@typespec/spec-coverage-sdk': 0.1.0-alpha.5-dev.0 - '@typespec/versioning': 0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5)) + '@typespec/versioning': 0.67.1(@typespec/compiler@0.67.2(@types/node@22.5.5)) ajv: 8.17.1 - axios: 1.8.1 body-parser: 1.20.3 deep-equal: 2.2.3 express: 4.21.2 - express-promise-router: 4.1.1(express@4.21.2) - form-data: 4.0.2 globby: 14.1.0 - jackspeak: 4.1.0 js-yaml: 4.1.0 + micromatch: 4.0.8 morgan: 1.10.0 - multer: 1.4.5-lts.1 - node-fetch: 3.3.2 + multer: 1.4.5-lts.2 picocolors: 1.1.1 source-map-support: 0.5.21 - winston: 3.17.0 xml2js: 0.6.2 yargs: 17.7.2 transitivePeerDependencies: - '@types/express' - '@types/node' - '@typespec/streams' - - debug - supports-color - '@typespec/sse@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/events@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10)))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10)))': + '@typespec/sse@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/events@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10)))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10)))': + dependencies: + '@typespec/compiler': 0.68.0-dev.12(@types/node@22.13.10) + '@typespec/events': 0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10)) + '@typespec/http': 0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))) + '@typespec/streams': 0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10)) + + '@typespec/sse@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/events@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)))': dependencies: - '@typespec/compiler': 0.67.1(@types/node@22.13.10) - '@typespec/events': 0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10)) - '@typespec/http': 0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))) - '@typespec/streams': 0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10)) + '@typespec/compiler': 0.68.0-dev.12(@types/node@22.5.5) + '@typespec/events': 0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)) + '@typespec/http': 0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))) + '@typespec/streams': 0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)) - '@typespec/sse@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/events@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5)))(@typespec/http@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5)))': + '@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))': dependencies: - '@typespec/compiler': 0.67.1(@types/node@22.5.5) - '@typespec/events': 0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5)) - '@typespec/http': 0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))(@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))) - '@typespec/streams': 0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5)) + '@typespec/compiler': 0.68.0-dev.12(@types/node@22.13.10) - '@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))': + '@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))': dependencies: - '@typespec/compiler': 0.67.1(@types/node@22.13.10) + '@typespec/compiler': 0.68.0-dev.12(@types/node@22.5.5) - '@typespec/streams@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))': + '@typespec/versioning@0.67.1(@typespec/compiler@0.67.2(@types/node@22.5.5))': dependencies: - '@typespec/compiler': 0.67.1(@types/node@22.5.5) + '@typespec/compiler': 0.67.2(@types/node@22.5.5) - '@typespec/versioning@0.67.1(@typespec/compiler@0.67.1(@types/node@22.13.10))': + '@typespec/versioning@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))': dependencies: - '@typespec/compiler': 0.67.1(@types/node@22.13.10) + '@typespec/compiler': 0.68.0-dev.12(@types/node@22.13.10) - '@typespec/versioning@0.67.1(@typespec/compiler@0.67.1(@types/node@22.5.5))': + '@typespec/versioning@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))': dependencies: - '@typespec/compiler': 0.67.1(@types/node@22.5.5) + '@typespec/compiler': 0.68.0-dev.12(@types/node@22.5.5) - '@typespec/xml@0.59.0(@typespec/compiler@0.67.1(@types/node@22.13.10))': + '@typespec/xml@0.59.0(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))': dependencies: - '@typespec/compiler': 0.67.1(@types/node@22.13.10) + '@typespec/compiler': 0.68.0-dev.12(@types/node@22.13.10) - '@typespec/xml@0.59.0(@typespec/compiler@0.67.1(@types/node@22.5.5))': + '@typespec/xml@0.59.0(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))': dependencies: - '@typespec/compiler': 0.67.1(@types/node@22.5.5) + '@typespec/compiler': 0.68.0-dev.12(@types/node@22.5.5) '@vitest/expect@3.0.8': dependencies: @@ -6438,10 +6628,6 @@ snapshots: ansi-regex@6.1.0: {} - ansi-styles@3.2.1: - dependencies: - color-convert: 1.9.3 - ansi-styles@4.3.0: dependencies: color-convert: 2.0.1 @@ -6464,8 +6650,8 @@ snapshots: call-bind: 1.0.7 define-properties: 1.2.1 es-abstract: 1.23.3 - es-object-atoms: 1.0.0 - get-intrinsic: 1.2.4 + es-object-atoms: 1.1.1 + get-intrinsic: 1.3.0 is-string: 1.0.7 array-timsort@1.0.3: {} @@ -6476,7 +6662,7 @@ snapshots: define-properties: 1.2.1 es-abstract: 1.23.3 es-errors: 1.3.0 - es-object-atoms: 1.0.0 + es-object-atoms: 1.1.1 es-shim-unscopables: 1.0.2 array.prototype.flat@1.3.2: @@ -6508,22 +6694,12 @@ snapshots: async@3.2.6: {} - asynckit@0.4.0: {} - autorest@3.7.1: {} available-typed-arrays@1.0.7: dependencies: possible-typed-array-names: 1.0.0 - axios@1.8.1: - dependencies: - follow-redirects: 1.15.9 - form-data: 4.0.2 - proxy-from-env: 1.1.0 - transitivePeerDependencies: - - debug - balanced-match@1.0.2: {} basic-auth@2.0.1: @@ -6649,12 +6825,6 @@ snapshots: dependencies: chalk: 5.3.0 - chalk@2.4.2: - dependencies: - ansi-styles: 3.2.1 - escape-string-regexp: 1.0.5 - supports-color: 5.5.0 - chalk@4.1.2: dependencies: ansi-styles: 4.3.0 @@ -6726,10 +6896,6 @@ snapshots: color: 3.2.1 text-hex: 1.0.0 - combined-stream@1.0.8: - dependencies: - delayed-stream: 1.0.0 - command-exists@1.2.9: {} commander@11.1.0: {} @@ -6903,8 +7069,6 @@ snapshots: transitivePeerDependencies: - encoding - data-uri-to-buffer@4.0.1: {} - data-view-buffer@1.0.1: dependencies: call-bind: 1.0.7 @@ -6946,7 +7110,7 @@ snapshots: array-buffer-byte-length: 1.0.1 call-bind: 1.0.7 es-get-iterator: 1.1.3 - get-intrinsic: 1.2.4 + get-intrinsic: 1.3.0 is-arguments: 1.1.1 is-array-buffer: 3.0.4 is-date-object: 1.0.5 @@ -6985,8 +7149,6 @@ snapshots: has-property-descriptors: 1.0.2 object-keys: 1.1.1 - delayed-stream@1.0.0: {} - depd@2.0.0: {} deprecation@2.3.1: {} @@ -7120,10 +7282,6 @@ snapshots: es-module-lexer@1.6.0: {} - es-object-atoms@1.0.0: - dependencies: - es-errors: 1.3.0 - es-object-atoms@1.1.1: dependencies: es-errors: 1.3.0 @@ -7492,11 +7650,6 @@ snapshots: fecha@4.2.3: {} - fetch-blob@3.2.0: - dependencies: - node-domexception: 1.0.0 - web-streams-polyfill: 3.3.3 - file-entry-cache@7.0.2: dependencies: flat-cache: 3.2.0 @@ -7551,8 +7704,6 @@ snapshots: fn.name@1.1.0: {} - follow-redirects@1.15.9: {} - for-each@0.3.3: dependencies: is-callable: 1.2.7 @@ -7562,17 +7713,6 @@ snapshots: cross-spawn: 7.0.3 signal-exit: 4.1.0 - form-data@4.0.2: - dependencies: - asynckit: 0.4.0 - combined-stream: 1.0.8 - es-set-tostringtag: 2.1.0 - mime-types: 2.1.35 - - formdata-polyfill@4.0.10: - dependencies: - fetch-blob: 3.2.0 - forwarded@0.2.0: {} fresh@0.5.2: {} @@ -7615,14 +7755,6 @@ snapshots: get-func-name@2.0.2: {} - get-intrinsic@1.2.4: - dependencies: - es-errors: 1.3.0 - function-bind: 1.1.2 - has-proto: 1.0.3 - has-symbols: 1.1.0 - hasown: 2.0.2 - get-intrinsic@1.3.0: dependencies: call-bind-apply-helpers: 1.0.2 @@ -7712,7 +7844,7 @@ snapshots: globby@14.0.2: dependencies: '@sindresorhus/merge-streams': 2.3.0 - fast-glob: 3.3.2 + fast-glob: 3.3.3 ignore: 5.3.2 path-type: 5.0.0 slash: 5.1.0 @@ -7735,8 +7867,6 @@ snapshots: has-bigints@1.0.2: {} - has-flag@3.0.0: {} - has-flag@4.0.0: {} has-own-prop@2.0.0: {} @@ -7747,13 +7877,11 @@ snapshots: has-proto@1.0.3: {} - has-symbols@1.0.3: {} - has-symbols@1.1.0: {} has-tostringtag@1.0.2: dependencies: - has-symbols: 1.0.3 + has-symbols: 1.1.0 hasown@2.0.2: dependencies: @@ -7997,10 +8125,6 @@ snapshots: optionalDependencies: '@pkgjs/parseargs': 0.11.0 - jackspeak@4.1.0: - dependencies: - '@isaacs/cliui': 8.0.2 - js-tokens@4.0.0: {} js-yaml@4.1.0: @@ -8124,15 +8248,6 @@ snapshots: chalk: 5.3.0 is-unicode-supported: 1.3.0 - logform@2.6.1: - dependencies: - '@colors/colors': 1.6.0 - '@types/triple-beam': 1.3.5 - fecha: 4.2.3 - ms: 2.1.3 - safe-stable-stringify: 2.5.0 - triple-beam: 1.4.1 - logform@2.7.0: dependencies: '@colors/colors': 1.6.0 @@ -8300,6 +8415,16 @@ snapshots: type-is: 1.6.18 xtend: 4.0.2 + multer@1.4.5-lts.2: + dependencies: + append-field: 1.0.0 + busboy: 1.6.0 + concat-stream: 1.6.2 + mkdirp: 0.5.6 + object-assign: 4.1.1 + type-is: 1.6.18 + xtend: 4.0.2 + mustache@4.2.0: {} mute-stream@2.0.0: {} @@ -8310,20 +8435,12 @@ snapshots: negotiator@0.6.3: {} - node-domexception@1.0.0: {} - node-fetch@2.7.0(encoding@0.1.13): dependencies: whatwg-url: 5.0.0 optionalDependencies: encoding: 0.1.13 - node-fetch@3.3.2: - dependencies: - data-uri-to-buffer: 4.0.1 - fetch-blob: 3.2.0 - formdata-polyfill: 4.0.10 - node-gyp@10.2.0: dependencies: env-paths: 2.2.1 @@ -8422,7 +8539,7 @@ snapshots: call-bind: 1.0.7 define-properties: 1.2.1 es-abstract: 1.23.3 - es-object-atoms: 1.0.0 + es-object-atoms: 1.1.1 object.groupby@1.0.3: dependencies: @@ -8434,7 +8551,7 @@ snapshots: dependencies: call-bind: 1.0.7 define-properties: 1.2.1 - es-object-atoms: 1.0.0 + es-object-atoms: 1.1.1 octokit@4.0.2: dependencies: @@ -8566,7 +8683,7 @@ snapshots: parse-json@5.2.0: dependencies: - '@babel/code-frame': 7.24.7 + '@babel/code-frame': 7.26.2 error-ex: 1.3.2 json-parse-even-better-errors: 2.3.1 lines-and-columns: 1.2.4 @@ -8650,8 +8767,6 @@ snapshots: forwarded: 0.2.0 ipaddr.js: 1.9.1 - proxy-from-env@1.1.0: {} - punycode@2.3.1: {} pure-rand@6.1.0: {} @@ -9038,10 +9153,6 @@ snapshots: strnum@1.0.5: {} - supports-color@5.5.0: - dependencies: - has-flag: 3.0.0 - supports-color@7.2.0: dependencies: has-flag: 4.0.0 @@ -9402,8 +9513,6 @@ snapshots: vscode-uri@3.1.0: {} - web-streams-polyfill@3.3.3: {} - webidl-conversions@3.0.1: {} whatwg-url@5.0.0: @@ -9447,12 +9556,6 @@ snapshots: siginfo: 2.0.0 stackback: 0.0.2 - winston-transport@4.7.1: - dependencies: - logform: 2.6.1 - readable-stream: 3.6.2 - triple-beam: 1.4.1 - winston-transport@4.9.0: dependencies: logform: 2.7.0 @@ -9465,13 +9568,13 @@ snapshots: '@dabh/diagnostics': 2.0.3 async: 3.2.6 is-stream: 2.0.1 - logform: 2.6.1 + logform: 2.7.0 one-time: 1.0.0 readable-stream: 3.6.2 safe-stable-stringify: 2.5.0 stack-trace: 0.0.10 triple-beam: 1.4.1 - winston-transport: 4.7.1 + winston-transport: 4.9.0 winston@3.17.0: dependencies: From ed0ca48a3dc8b05aab4848e2439808c8c3bd85da Mon Sep 17 00:00:00 2001 From: AutoPrFromHttpClientPython Date: Mon, 31 Mar 2025 09:26:56 +0000 Subject: [PATCH 02/19] Regenerate for typespec-python (2025-03-31 09:26:56) --- .../azure/core/page/operations/_operations.py | 2 +- .../CHANGELOG.md | 5 + .../LICENSE | 21 + .../MANIFEST.in | 7 + .../README.md | 78 + .../apiview-properties.json | 11 + .../azure/__init__.py | 1 + .../azure/resourcemanager/__init__.py | 1 + .../resourcemanager/nonresource/__init__.py | 26 + .../resourcemanager/nonresource/_client.py | 110 + .../nonresource/_configuration.py | 68 + .../nonresource/_model_base.py | 1230 ++++++++++ .../resourcemanager/nonresource/_patch.py | 21 + .../nonresource/_serialization.py | 2026 +++++++++++++++++ .../resourcemanager/nonresource/_version.py | 3 + .../nonresource/aio/__init__.py | 23 + .../nonresource/aio/_client.py | 112 + .../nonresource/aio/_configuration.py | 68 + .../resourcemanager/nonresource/aio/_patch.py | 21 + .../nonresource/aio/operations/__init__.py | 19 + .../nonresource/aio/operations/_operations.py | 268 +++ .../nonresource/aio/operations/_patch.py | 21 + .../nonresource/models/__init__.py | 27 + .../nonresource/models/_models.py | 122 + .../nonresource/models/_patch.py | 21 + .../nonresource/operations/__init__.py | 19 + .../nonresource/operations/_operations.py | 327 +++ .../nonresource/operations/_patch.py | 21 + .../resourcemanager/nonresource/py.typed | 1 + .../dev_requirements.txt | 5 + .../generated_tests/conftest.py | 29 + ...urce_non_resource_operations_operations.py | 36 + ...on_resource_operations_operations_async.py | 37 + .../setup.py | 65 + .../client/structure/service/_client.py | 2 +- .../client/structure/service/aio/_client.py | 2 +- .../service/aio/operations/_operations.py | 18 +- .../service/operations/_operations.py | 18 +- .../client/structure/multiclient/_client.py | 4 +- .../multiclient/_operations/_operations.py | 12 +- .../structure/multiclient/aio/_client.py | 4 +- .../aio/_operations/_operations.py | 12 +- .../structure/renamedoperation/_client.py | 2 +- .../structure/renamedoperation/aio/_client.py | 2 +- .../aio/operations/_operations.py | 12 +- .../operations/_operations.py | 12 +- .../structure/twooperationgroup/_client.py | 2 +- .../twooperationgroup/aio/_client.py | 2 +- .../aio/operations/_operations.py | 12 +- .../operations/_operations.py | 12 +- .../aio/operations/_operations.py | 2 +- .../responsebody/operations/_operations.py | 2 +- .../generated_tests/test_visibility.py | 14 +- .../generated_tests/test_visibility_async.py | 14 +- .../_operations/_operations.py | 54 +- .../aio/_operations/_operations.py | 40 +- .../headasbooleanfalse/models/_models.py | 5 - .../generated_tests/test_visibility.py | 14 +- .../generated_tests/test_visibility_async.py | 14 +- .../_operations/_operations.py | 56 +- .../aio/_operations/_operations.py | 40 +- .../headasbooleantrue/models/_models.py | 5 - .../payload-multipart/apiview-properties.json | 1 + .../test_multi_part_form_data_operations.py | 1 - ...t_multi_part_form_data_operations_async.py | 1 - .../multipart/aio/operations/_operations.py | 22 +- .../payload/multipart/models/__init__.py | 2 + .../payload/multipart/models/_models.py | 30 + .../multipart/operations/_operations.py | 22 +- .../resiliency/srv/driven1/_client.py | 2 +- .../srv/driven1/_operations/_operations.py | 6 +- .../resiliency/srv/driven1/aio/_client.py | 2 +- .../driven1/aio/_operations/_operations.py | 6 +- .../resiliency/srv/driven2/_client.py | 2 +- .../srv/driven2/_operations/_operations.py | 8 +- .../resiliency/srv/driven2/aio/_client.py | 2 +- .../driven2/aio/_operations/_operations.py | 8 +- .../server/path/multiple/_client.py | 2 +- .../path/multiple/_operations/_operations.py | 4 +- .../server/path/multiple/aio/_client.py | 2 +- .../multiple/aio/_operations/_operations.py | 4 +- .../server/path/single/_client.py | 2 +- .../path/single/_operations/_operations.py | 2 +- .../server/path/single/aio/_client.py | 2 +- .../single/aio/_operations/_operations.py | 2 +- .../server/versions/notversioned/_client.py | 2 +- .../notversioned/_operations/_operations.py | 6 +- .../versions/notversioned/aio/_client.py | 2 +- .../aio/_operations/_operations.py | 6 +- .../server/versions/versioned/_client.py | 2 +- .../versioned/_operations/_operations.py | 8 +- .../server/versions/versioned/aio/_client.py | 2 +- .../versioned/aio/_operations/_operations.py | 8 +- .../generated_tests/test_visibility.py | 14 +- .../generated_tests/test_visibility_async.py | 14 +- .../visibility/_operations/_operations.py | 56 +- .../visibility/aio/_operations/_operations.py | 40 +- .../model/visibility/models/_models.py | 5 - .../versioning/added/_client.py | 2 +- .../versioning/added/aio/_client.py | 2 +- .../added/aio/operations/_operations.py | 6 +- .../added/operations/_operations.py | 6 +- .../versioning/madeoptional/_client.py | 2 +- .../madeoptional/_operations/_operations.py | 2 +- .../versioning/madeoptional/aio/_client.py | 2 +- .../aio/_operations/_operations.py | 2 +- .../versioning/removed/_client.py | 2 +- .../removed/_operations/_operations.py | 4 +- .../versioning/removed/aio/_client.py | 2 +- .../removed/aio/_operations/_operations.py | 4 +- .../versioning/renamedfrom/_client.py | 2 +- .../versioning/renamedfrom/aio/_client.py | 2 +- .../renamedfrom/aio/operations/_operations.py | 4 +- .../renamedfrom/operations/_operations.py | 4 +- .../returntypechangedfrom/_client.py | 2 +- .../_operations/_operations.py | 11 +- .../returntypechangedfrom/aio/_client.py | 2 +- .../aio/_operations/_operations.py | 9 +- .../versioning/typechangedfrom/_client.py | 2 +- .../_operations/_operations.py | 2 +- .../versioning/typechangedfrom/aio/_client.py | 2 +- .../aio/_operations/_operations.py | 2 +- .../aio/operations/_operations.py | 2 +- .../responsebody/operations/_operations.py | 2 +- .../_operations/_operations.py | 54 +- .../aio/_operations/_operations.py | 40 +- .../headasbooleanfalse/models/_models.py | 5 - .../_operations/_operations.py | 56 +- .../aio/_operations/_operations.py | 40 +- .../headasbooleantrue/models/_models.py | 5 - .../formdata/aio/operations/_operations.py | 23 +- .../multipart/formdata/models/__init__.py | 21 + .../multipart/formdata/models/_models.py | 38 + .../multipart/formdata/models/_patch.py | 18 + .../formdata/operations/_operations.py | 23 +- .../server/path/multiple/_client.py | 2 +- .../path/multiple/_operations/_operations.py | 4 +- .../server/path/multiple/aio/_client.py | 2 +- .../multiple/aio/_operations/_operations.py | 4 +- .../server/path/single/_client.py | 2 +- .../path/single/_operations/_operations.py | 2 +- .../server/path/single/aio/_client.py | 2 +- .../single/aio/_operations/_operations.py | 2 +- .../server/versions/notversioned/_client.py | 2 +- .../notversioned/_operations/_operations.py | 6 +- .../versions/notversioned/aio/_client.py | 2 +- .../aio/_operations/_operations.py | 6 +- .../server/versions/versioned/_client.py | 2 +- .../versioned/_operations/_operations.py | 8 +- .../server/versions/versioned/aio/_client.py | 2 +- .../versioned/aio/_operations/_operations.py | 8 +- .../visibility/_operations/_operations.py | 56 +- .../visibility/aio/_operations/_operations.py | 40 +- .../model/visibility/models/_models.py | 5 - .../versioning/added/_client.py | 2 +- .../versioning/added/aio/_client.py | 2 +- .../added/aio/operations/_operations.py | 6 +- .../added/operations/_operations.py | 6 +- .../versioning/madeoptional/_client.py | 2 +- .../madeoptional/_operations/_operations.py | 2 +- .../versioning/madeoptional/aio/_client.py | 2 +- .../aio/_operations/_operations.py | 2 +- .../versioning/removed/_client.py | 2 +- .../removed/_operations/_operations.py | 4 +- .../versioning/removed/aio/_client.py | 2 +- .../removed/aio/_operations/_operations.py | 4 +- .../versioning/renamedfrom/_client.py | 2 +- .../versioning/renamedfrom/aio/_client.py | 2 +- .../renamedfrom/aio/operations/_operations.py | 4 +- .../renamedfrom/operations/_operations.py | 4 +- .../returntypechangedfrom/_client.py | 2 +- .../_operations/_operations.py | 11 +- .../returntypechangedfrom/aio/_client.py | 2 +- .../aio/_operations/_operations.py | 9 +- .../versioning/typechangedfrom/_client.py | 2 +- .../_operations/_operations.py | 2 +- .../versioning/typechangedfrom/aio/_client.py | 2 +- .../aio/_operations/_operations.py | 2 +- 178 files changed, 5715 insertions(+), 469 deletions(-) create mode 100644 packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/CHANGELOG.md create mode 100644 packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/LICENSE create mode 100644 packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/MANIFEST.in create mode 100644 packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/README.md create mode 100644 packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/apiview-properties.json create mode 100644 packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/azure/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/azure/resourcemanager/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/azure/resourcemanager/nonresource/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/azure/resourcemanager/nonresource/_client.py create mode 100644 packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/azure/resourcemanager/nonresource/_configuration.py create mode 100644 packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/azure/resourcemanager/nonresource/_model_base.py create mode 100644 packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/azure/resourcemanager/nonresource/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/azure/resourcemanager/nonresource/_serialization.py create mode 100644 packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/azure/resourcemanager/nonresource/_version.py create mode 100644 packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/azure/resourcemanager/nonresource/aio/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/azure/resourcemanager/nonresource/aio/_client.py create mode 100644 packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/azure/resourcemanager/nonresource/aio/_configuration.py create mode 100644 packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/azure/resourcemanager/nonresource/aio/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/azure/resourcemanager/nonresource/aio/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/azure/resourcemanager/nonresource/aio/operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/azure/resourcemanager/nonresource/aio/operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/azure/resourcemanager/nonresource/models/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/azure/resourcemanager/nonresource/models/_models.py create mode 100644 packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/azure/resourcemanager/nonresource/models/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/azure/resourcemanager/nonresource/operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/azure/resourcemanager/nonresource/operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/azure/resourcemanager/nonresource/operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/azure/resourcemanager/nonresource/py.typed create mode 100644 packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/dev_requirements.txt create mode 100644 packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/generated_tests/conftest.py create mode 100644 packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/generated_tests/test_non_resource_non_resource_operations_operations.py create mode 100644 packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/generated_tests/test_non_resource_non_resource_operations_operations_async.py create mode 100644 packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/setup.py create mode 100644 packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/formdata/models/__init__.py create mode 100644 packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/formdata/models/_models.py create mode 100644 packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/formdata/models/_patch.py diff --git a/packages/typespec-python/test/azure/generated/azure-core-page/specs/azure/core/page/operations/_operations.py b/packages/typespec-python/test/azure/generated/azure-core-page/specs/azure/core/page/operations/_operations.py index 84164ee4a3d..8000692bdec 100644 --- a/packages/typespec-python/test/azure/generated/azure-core-page/specs/azure/core/page/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/azure-core-page/specs/azure/core/page/operations/_operations.py @@ -122,7 +122,7 @@ def build_page_list_with_parameters_request( _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) def build_page_list_with_custom_page_model_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long diff --git a/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/CHANGELOG.md b/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/CHANGELOG.md new file mode 100644 index 00000000000..628743d283a --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/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/azure-resource-manager-non-resource/LICENSE b/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/LICENSE new file mode 100644 index 00000000000..63447fd8bbb --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/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/azure-resource-manager-non-resource/MANIFEST.in b/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/MANIFEST.in new file mode 100644 index 00000000000..d9b99ad4e2b --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/MANIFEST.in @@ -0,0 +1,7 @@ +include *.md +include LICENSE +include azure/resourcemanager/nonresource/py.typed +recursive-include tests *.py +recursive-include samples *.py *.md +include azure/__init__.py +include azure/resourcemanager/__init__.py diff --git a/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/README.md b/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/README.md new file mode 100644 index 00000000000..1b3cb2e058c --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/README.md @@ -0,0 +1,78 @@ +# Azure Resourcemanager Nonresource client library for Python + + +## Getting started + +### Install the package + +```bash +python -m pip install azure-resourcemanager-nonresource +``` + +#### 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 Resourcemanager Nonresource instance. + +#### Create with an Azure Active Directory Credential +To use an [Azure Active Directory (AAD) token credential][authenticate_with_token], +provide an instance of the desired credential type obtained from the +[azure-identity][azure_identity_credentials] library. + +To authenticate with AAD, you must first [pip][pip] install [`azure-identity`][azure_identity_pip] + +After setup, you can choose which type of [credential][azure_identity_credentials] from azure.identity to use. +As an example, [DefaultAzureCredential][default_azure_credential] can be used to authenticate the client: + +Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: +`AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET` + +Use the returned token credential to authenticate the client: + +```python +>>> from azure.resourcemanager.nonresource import NonResourceClient +>>> from azure.identity import DefaultAzureCredential +>>> client = NonResourceClient(endpoint='', credential=DefaultAzureCredential()) +``` + +## Examples + +```python +>>> from azure.resourcemanager.nonresource import NonResourceClient +>>> from azure.identity import DefaultAzureCredential +>>> from azure.core.exceptions import HttpResponseError + +>>> client = NonResourceClient(endpoint='', credential=DefaultAzureCredential()) +>>> try: + + except HttpResponseError as e: + print('service responds error: {}'.format(e.response.json())) + +``` + +## 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/azure-resource-manager-non-resource/apiview-properties.json b/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/apiview-properties.json new file mode 100644 index 00000000000..a7196e96b95 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/apiview-properties.json @@ -0,0 +1,11 @@ +{ + "CrossLanguagePackageId": "Azure.ResourceManager.NonResource", + "CrossLanguageDefinitionId": { + "azure.resourcemanager.nonresource.models.ErrorAdditionalInfo": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo", + "azure.resourcemanager.nonresource.models.ErrorDetail": "Azure.ResourceManager.CommonTypes.ErrorDetail", + "azure.resourcemanager.nonresource.models.ErrorResponse": "Azure.ResourceManager.CommonTypes.ErrorResponse", + "azure.resourcemanager.nonresource.models.NonResource": "Azure.ResourceManager.NonResource.NonResource", + "azure.resourcemanager.nonresource.NonResourceClient.non_resource_operations.get": "Azure.ResourceManager.NonResource.NonResourceOperations.get", + "azure.resourcemanager.nonresource.NonResourceClient.non_resource_operations.create": "Azure.ResourceManager.NonResource.NonResourceOperations.create" + } +} \ No newline at end of file diff --git a/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/azure/__init__.py b/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/azure/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/azure/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/azure/resourcemanager/__init__.py b/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/azure/resourcemanager/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/azure/resourcemanager/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/azure/resourcemanager/nonresource/__init__.py b/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/azure/resourcemanager/nonresource/__init__.py new file mode 100644 index 00000000000..fe390756527 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/azure/resourcemanager/nonresource/__init__.py @@ -0,0 +1,26 @@ +# coding=utf-8 +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._client import NonResourceClient # type: ignore +from ._version import VERSION + +__version__ = VERSION + +try: + from ._patch import __all__ as _patch_all + from ._patch import * +except ImportError: + _patch_all = [] +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "NonResourceClient", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore + +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/azure/resourcemanager/nonresource/_client.py b/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/azure/resourcemanager/nonresource/_client.py new file mode 100644 index 00000000000..34e82f27178 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/azure/resourcemanager/nonresource/_client.py @@ -0,0 +1,110 @@ +# coding=utf-8 + +from copy import deepcopy +from typing import Any, TYPE_CHECKING +from typing_extensions import Self + +from azure.core.pipeline import policies +from azure.core.rest import HttpRequest, HttpResponse +from azure.mgmt.core import ARMPipelineClient +from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy + +from ._configuration import NonResourceClientConfiguration +from ._serialization import Deserializer, Serializer +from .operations import NonResourceOperationsOperations + +if TYPE_CHECKING: + from azure.core.credentials import TokenCredential + + +class NonResourceClient: + """Arm Resource Provider management API. + + :ivar non_resource_operations: NonResourceOperationsOperations operations + :vartype non_resource_operations: + azure.resourcemanager.nonresource.operations.NonResourceOperationsOperations + :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. + :type subscription_id: str + :param base_url: Service host. Default value is "https://management.azure.com". + :type base_url: str + :keyword api_version: The API version to use for this operation. Default value is + "2023-12-01-preview". Note that overriding this default value may result in unsupported + behavior. + :paramtype api_version: str + """ + + def __init__( + self, + credential: "TokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + **kwargs: Any + ) -> None: + _endpoint = "{endpoint}" + self._config = NonResourceClientConfiguration( + credential=credential, subscription_id=subscription_id, base_url=base_url, **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), + ARMAutoResourceProviderRegistrationPolicy(), + 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: ARMPipelineClient = ARMPipelineClient(base_url=_endpoint, policies=_policies, **kwargs) + + self._serialize = Serializer() + self._deserialize = Deserializer() + self._serialize.client_side_validation = False + self.non_resource_operations = NonResourceOperationsOperations( + 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.base_url", self._config.base_url, "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/azure-resource-manager-non-resource/azure/resourcemanager/nonresource/_configuration.py b/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/azure/resourcemanager/nonresource/_configuration.py new file mode 100644 index 00000000000..f13c9ef4598 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/azure/resourcemanager/nonresource/_configuration.py @@ -0,0 +1,68 @@ +# coding=utf-8 + +from typing import Any, TYPE_CHECKING + +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy + +from ._version import VERSION + +if TYPE_CHECKING: + from azure.core.credentials import TokenCredential + + +class NonResourceClientConfiguration: # pylint: disable=too-many-instance-attributes + """Configuration for NonResourceClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :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. + :type subscription_id: str + :param base_url: Service host. Default value is "https://management.azure.com". + :type base_url: str + :keyword api_version: The API version to use for this operation. Default value is + "2023-12-01-preview". Note that overriding this default value may result in unsupported + behavior. + :paramtype api_version: str + """ + + def __init__( + self, + credential: "TokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + **kwargs: Any + ) -> None: + api_version: str = kwargs.pop("api_version", "2023-12-01-preview") + + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + + self.credential = credential + self.subscription_id = subscription_id + self.base_url = base_url + self.api_version = api_version + self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) + kwargs.setdefault("sdk_moniker", "resourcemanager-nonresource/{}".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 ARMHttpLoggingPolicy(**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") + if self.credential and not self.authentication_policy: + self.authentication_policy = ARMChallengeAuthenticationPolicy( + self.credential, *self.credential_scopes, **kwargs + ) diff --git a/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/azure/resourcemanager/nonresource/_model_base.py b/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/azure/resourcemanager/nonresource/_model_base.py new file mode 100644 index 00000000000..e8ecb270bd8 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/azure/resourcemanager/nonresource/_model_base.py @@ -0,0 +1,1230 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# pylint: disable=protected-access, 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 +import xml.etree.ElementTree as ET +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"] + 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)) + + +def _deserialize_int_as_str(attr): + if isinstance(attr, int): + return attr + return int(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 annotation is int and rf and rf._format == "str": + return _deserialize_int_as_str + if rf and rf._format: + return _DESERIALIZE_MAPPING_WITHFORMAT.get(rf._format) + return _DESERIALIZE_MAPPING.get(annotation) # pyright: ignore + + +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]: + """ + :returns: a set-like object providing a view on D's keys + :rtype: ~typing.KeysView + """ + return self._data.keys() + + def values(self) -> typing.ValuesView[typing.Any]: + """ + :returns: an object providing a view on D's values + :rtype: ~typing.ValuesView + """ + return self._data.values() + + def items(self) -> typing.ItemsView[str, typing.Any]: + """ + :returns: set-like object providing a view on D's items + :rtype: ~typing.ItemsView + """ + return self._data.items() + + def get(self, key: str, default: typing.Any = None) -> typing.Any: + """ + Get the value for key if key is in the dictionary, else default. + :param str key: The key to look up. + :param any default: The value to return if key is not in the dictionary. Defaults to None + :returns: D[k] if k in D, else d. + :rtype: 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: + """ + Removes specified key and return the corresponding value. + :param str key: The key to pop. + :param any default: The value to return if key is not in the dictionary + :returns: The value corresponding to the key. + :rtype: any + :raises KeyError: If key is not found and default is not given. + """ + if default is _UNSET: + return self._data.pop(key) + return self._data.pop(key, default) + + def popitem(self) -> typing.Tuple[str, typing.Any]: + """ + Removes and returns some (key, value) pair + :returns: The (key, value) pair. + :rtype: tuple + :raises KeyError: if D is empty. + """ + return self._data.popitem() + + def clear(self) -> None: + """ + Remove all items from D. + """ + self._data.clear() + + def update(self, *args: typing.Any, **kwargs: typing.Any) -> None: + """ + Updates D from mapping/iterable E and F. + :param any args: Either a mapping object or an iterable of key-value pairs. + """ + 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: + """ + Same as calling D.get(k, d), and setting D[k]=d if k not found + :param str key: The key to look up. + :param any default: The value to set if key is not in the dictionary + :returns: D[k] if k in D, else d. + :rtype: 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) + if isinstance(value, ET.Element): + value = _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: # pylint: disable=too-many-nested-blocks + if isinstance(args[0], ET.Element): + existed_attr_keys = [] + model_meta = getattr(self, "_xml", {}) + + for rf in self._attr_to_rest_field.values(): + prop_meta = getattr(rf, "_xml", {}) + xml_name = prop_meta.get("name", rf._rest_name) + xml_ns = prop_meta.get("ns", model_meta.get("ns", None)) + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + + # attribute + if prop_meta.get("attribute", False) and args[0].get(xml_name) is not None: + existed_attr_keys.append(xml_name) + dict_to_pass[rf._rest_name] = _deserialize(rf._type, args[0].get(xml_name)) + continue + + # unwrapped element is array + if prop_meta.get("unwrapped", False): + # unwrapped array could either use prop items meta/prop meta + if prop_meta.get("itemsName"): + xml_name = prop_meta.get("itemsName") + xml_ns = prop_meta.get("itemNs") + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + items = args[0].findall(xml_name) # pyright: ignore + if len(items) > 0: + existed_attr_keys.append(xml_name) + dict_to_pass[rf._rest_name] = _deserialize(rf._type, items) + continue + + # text element is primitive type + if prop_meta.get("text", False): + if args[0].text is not None: + dict_to_pass[rf._rest_name] = _deserialize(rf._type, args[0].text) + continue + + # wrapped element could be normal property or array, it should only have one element + item = args[0].find(xml_name) + if item is not None: + existed_attr_keys.append(xml_name) + dict_to_pass[rf._rest_name] = _deserialize(rf._type, item) + + # rest thing is additional properties + for e in args[0]: + if e.tag not in existed_attr_keys: + dict_to_pass[e.tag] = _convert_element(e) + else: + 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: + 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__") + for k, v in mro_class.__annotations__.items() + } + 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__"): + base.__mapping__[discriminator or cls.__name__] = cls # type: ignore + + @classmethod + def _get_discriminator(cls, exist_discriminators) -> typing.Optional["_RestField"]: + for v in cls.__dict__.values(): + if isinstance(v, _RestField) and v._is_discriminator and v._rest_name not in exist_discriminators: + return v + return None + + @classmethod + def _deserialize(cls, data, exist_discriminators): + if not hasattr(cls, "__mapping__"): + return cls(data) + discriminator = cls._get_discriminator(exist_discriminators) + if discriminator is None: + return cls(data) + exist_discriminators.append(discriminator._rest_name) + if isinstance(data, ET.Element): + model_meta = getattr(cls, "_xml", {}) + prop_meta = getattr(discriminator, "_xml", {}) + xml_name = prop_meta.get("name", discriminator._rest_name) + xml_ns = prop_meta.get("ns", model_meta.get("ns", None)) + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + + if data.get(xml_name) is not None: + discriminator_value = data.get(xml_name) + else: + discriminator_value = data.find(xml_name).text # pyright: ignore + else: + discriminator_value = data.get(discriminator._rest_name) + mapped_cls = cls.__mapping__.get(discriminator_value, cls) # pyright: ignore + return mapped_cls._deserialize(data, exist_discriminators) + + def as_dict(self, *, exclude_readonly: bool = False) -> typing.Dict[str, typing.Any]: + """Return a dict that can be turned into json 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 + if isinstance(obj, ET.Element): + obj = {child.tag: child for child in 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 + if isinstance(obj, ET.Element): + obj = list(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=too-many-return-statements, too-many-branches + annotation: typing.Any, + module: typing.Optional[str], + rf: typing.Optional["_RestField"] = None, +) -> typing.Optional[typing.Callable[[typing.Any], typing.Any]]: + if not annotation: + 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) # type: ignore + + 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, +): # pylint: disable=too-many-return-statements + try: + if value is None or isinstance(value, _Null): + return None + if isinstance(value, ET.Element): + if deserializer is str: + return value.text or "" + if deserializer is int: + return int(value.text) if value.text else None + if deserializer is float: + return float(value.text) if value.text else None + if deserializer is bool: + return value.text == "true" if value.text else None + if deserializer is None: + return value + if deserializer in [int, float, bool]: + return deserializer(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) + + +def _failsafe_deserialize( + deserializer: typing.Any, + value: typing.Any, + module: typing.Optional[str] = None, + rf: typing.Optional["_RestField"] = None, + format: typing.Optional[str] = None, +) -> typing.Any: + try: + return _deserialize(deserializer, value, module, rf, format) + except DeserializationError: + _LOGGER.warning( + "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True + ) + return None + + +def _failsafe_deserialize_xml( + deserializer: typing.Any, + value: typing.Any, +) -> typing.Any: + try: + return _deserialize_xml(deserializer, value) + except DeserializationError: + _LOGGER.warning( + "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True + ) + return None + + +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, + xml: typing.Optional[typing.Dict[str, typing.Any]] = None, + ): + 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 + self._xml = xml if xml is not None else {} + + @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, + xml: typing.Optional[typing.Dict[str, typing.Any]] = None, +) -> typing.Any: + return _RestField( + name=name, + type=type, + visibility=visibility, + default=default, + format=format, + is_multipart_file_input=is_multipart_file_input, + xml=xml, + ) + + +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, + xml: typing.Optional[typing.Dict[str, typing.Any]] = None, +) -> typing.Any: + return _RestField(name=name, type=type, is_discriminator=True, visibility=visibility, xml=xml) + + +def serialize_xml(model: Model, exclude_readonly: bool = False) -> str: + """Serialize a model to XML. + + :param Model model: The model to serialize. + :param bool exclude_readonly: Whether to exclude readonly properties. + :returns: The XML representation of the model. + :rtype: str + """ + return ET.tostring(_get_element(model, exclude_readonly), encoding="unicode") # type: ignore + + +def _get_element( + o: typing.Any, + exclude_readonly: bool = False, + parent_meta: typing.Optional[typing.Dict[str, typing.Any]] = None, + wrapped_element: typing.Optional[ET.Element] = None, +) -> typing.Union[ET.Element, typing.List[ET.Element]]: + if _is_model(o): + model_meta = getattr(o, "_xml", {}) + + # if prop is a model, then use the prop element directly, else generate a wrapper of model + if wrapped_element is None: + wrapped_element = _create_xml_element( + model_meta.get("name", o.__class__.__name__), + model_meta.get("prefix"), + model_meta.get("ns"), + ) + + readonly_props = [] + if exclude_readonly: + readonly_props = [p._rest_name for p in o._attr_to_rest_field.values() if _is_readonly(p)] + + for k, v in o.items(): + # do not serialize readonly properties + if exclude_readonly and k in readonly_props: + continue + + prop_rest_field = _get_rest_field(o._attr_to_rest_field, k) + if prop_rest_field: + prop_meta = getattr(prop_rest_field, "_xml").copy() + # use the wire name as xml name if no specific name is set + if prop_meta.get("name") is None: + prop_meta["name"] = k + else: + # additional properties will not have rest field, use the wire name as xml name + prop_meta = {"name": k} + + # if no ns for prop, use model's + if prop_meta.get("ns") is None and model_meta.get("ns"): + prop_meta["ns"] = model_meta.get("ns") + prop_meta["prefix"] = model_meta.get("prefix") + + if prop_meta.get("unwrapped", False): + # unwrapped could only set on array + wrapped_element.extend(_get_element(v, exclude_readonly, prop_meta)) + elif prop_meta.get("text", False): + # text could only set on primitive type + wrapped_element.text = _get_primitive_type_value(v) + elif prop_meta.get("attribute", False): + xml_name = prop_meta.get("name", k) + if prop_meta.get("ns"): + ET.register_namespace(prop_meta.get("prefix"), prop_meta.get("ns")) # pyright: ignore + xml_name = "{" + prop_meta.get("ns") + "}" + xml_name # pyright: ignore + # attribute should be primitive type + wrapped_element.set(xml_name, _get_primitive_type_value(v)) + else: + # other wrapped prop element + wrapped_element.append(_get_wrapped_element(v, exclude_readonly, prop_meta)) + return wrapped_element + if isinstance(o, list): + return [_get_element(x, exclude_readonly, parent_meta) for x in o] # type: ignore + if isinstance(o, dict): + result = [] + for k, v in o.items(): + result.append( + _get_wrapped_element( + v, + exclude_readonly, + { + "name": k, + "ns": parent_meta.get("ns") if parent_meta else None, + "prefix": parent_meta.get("prefix") if parent_meta else None, + }, + ) + ) + return result + + # primitive case need to create element based on parent_meta + if parent_meta: + return _get_wrapped_element( + o, + exclude_readonly, + { + "name": parent_meta.get("itemsName", parent_meta.get("name")), + "prefix": parent_meta.get("itemsPrefix", parent_meta.get("prefix")), + "ns": parent_meta.get("itemsNs", parent_meta.get("ns")), + }, + ) + + raise ValueError("Could not serialize value into xml: " + o) + + +def _get_wrapped_element( + v: typing.Any, + exclude_readonly: bool, + meta: typing.Optional[typing.Dict[str, typing.Any]], +) -> ET.Element: + wrapped_element = _create_xml_element( + meta.get("name") if meta else None, meta.get("prefix") if meta else None, meta.get("ns") if meta else None + ) + if isinstance(v, (dict, list)): + wrapped_element.extend(_get_element(v, exclude_readonly, meta)) + elif _is_model(v): + _get_element(v, exclude_readonly, meta, wrapped_element) + else: + wrapped_element.text = _get_primitive_type_value(v) + return wrapped_element + + +def _get_primitive_type_value(v) -> str: + if v is True: + return "true" + if v is False: + return "false" + if isinstance(v, _Null): + return "" + return str(v) + + +def _create_xml_element(tag, prefix=None, ns=None): + if prefix and ns: + ET.register_namespace(prefix, ns) + if ns: + return ET.Element("{" + ns + "}" + tag) + return ET.Element(tag) + + +def _deserialize_xml( + deserializer: typing.Any, + value: str, +) -> typing.Any: + element = ET.fromstring(value) # nosec + return _deserialize(deserializer, element) + + +def _convert_element(e: ET.Element): + # dict case + if len(e.attrib) > 0 or len({child.tag for child in e}) > 1: + dict_result: typing.Dict[str, typing.Any] = {} + for child in e: + if dict_result.get(child.tag) is not None: + if isinstance(dict_result[child.tag], list): + dict_result[child.tag].append(_convert_element(child)) + else: + dict_result[child.tag] = [dict_result[child.tag], _convert_element(child)] + else: + dict_result[child.tag] = _convert_element(child) + dict_result.update(e.attrib) + return dict_result + # array case + if len(e) > 0: + array_result: typing.List[typing.Any] = [] + for child in e: + array_result.append(_convert_element(child)) + return array_result + # primitive case + return e.text diff --git a/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/azure/resourcemanager/nonresource/_patch.py b/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/azure/resourcemanager/nonresource/_patch.py new file mode 100644 index 00000000000..8bcb627aa47 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/azure/resourcemanager/nonresource/_patch.py @@ -0,0 +1,21 @@ +# 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. +# -------------------------------------------------------------------------- +"""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/azure-resource-manager-non-resource/azure/resourcemanager/nonresource/_serialization.py b/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/azure/resourcemanager/nonresource/_serialization.py new file mode 100644 index 00000000000..f71dbc0833e --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/azure/resourcemanager/nonresource/_serialization.py @@ -0,0 +1,2026 @@ +# pylint: disable=line-too-long,useless-suppression,too-many-lines +# coding=utf-8 + +# 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, + MutableMapping, + 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 typing_extensions import Self + +from azure.core.exceptions import DeserializationError, SerializationError +from azure.core.serialization import NULL as CoreNull + +_BOM = codecs.BOM_UTF8.decode(encoding="utf-8") + +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 + +TZ_UTC = datetime.timezone.utc + +_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, data: Any, content_type: Optional[str] = None) -> Self: + """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: Self + """ + deserializer = Deserializer(cls._infer_class_models()) + return deserializer(cls.__name__, data, content_type=content_type) # type: ignore + + @classmethod + def from_dict( + cls, + data: Any, + key_extractors: Optional[Callable[[str, Dict[str, Any], Any], Any]] = None, + content_type: Optional[str] = None, + ) -> Self: + """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: Self + """ + 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. + + :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.get(rest_api_response_key, None) or response.get(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: # 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) -> 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( + 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: + """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) -> 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() # pylint: disable=protected-access # type: ignore + if v.get("readonly") + ] + const = [ + k + for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore + if v.get("constant") + ] + 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 # type: ignore + 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=datetime.timezone(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/azure-resource-manager-non-resource/azure/resourcemanager/nonresource/_version.py b/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/azure/resourcemanager/nonresource/_version.py new file mode 100644 index 00000000000..9f6458b8cda --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/azure/resourcemanager/nonresource/_version.py @@ -0,0 +1,3 @@ +# coding=utf-8 + +VERSION = "1.0.0b1" diff --git a/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/azure/resourcemanager/nonresource/aio/__init__.py b/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/azure/resourcemanager/nonresource/aio/__init__.py new file mode 100644 index 00000000000..7f236f06de5 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/azure/resourcemanager/nonresource/aio/__init__.py @@ -0,0 +1,23 @@ +# coding=utf-8 +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._client import NonResourceClient # type: ignore + +try: + from ._patch import __all__ as _patch_all + from ._patch import * +except ImportError: + _patch_all = [] +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "NonResourceClient", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore + +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/azure/resourcemanager/nonresource/aio/_client.py b/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/azure/resourcemanager/nonresource/aio/_client.py new file mode 100644 index 00000000000..8c93070e981 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/azure/resourcemanager/nonresource/aio/_client.py @@ -0,0 +1,112 @@ +# coding=utf-8 + +from copy import deepcopy +from typing import Any, Awaitable, TYPE_CHECKING +from typing_extensions import Self + +from azure.core.pipeline import policies +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.mgmt.core import AsyncARMPipelineClient +from azure.mgmt.core.policies import AsyncARMAutoResourceProviderRegistrationPolicy + +from .._serialization import Deserializer, Serializer +from ._configuration import NonResourceClientConfiguration +from .operations import NonResourceOperationsOperations + +if TYPE_CHECKING: + from azure.core.credentials_async import AsyncTokenCredential + + +class NonResourceClient: + """Arm Resource Provider management API. + + :ivar non_resource_operations: NonResourceOperationsOperations operations + :vartype non_resource_operations: + azure.resourcemanager.nonresource.aio.operations.NonResourceOperationsOperations + :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. + :type subscription_id: str + :param base_url: Service host. Default value is "https://management.azure.com". + :type base_url: str + :keyword api_version: The API version to use for this operation. Default value is + "2023-12-01-preview". Note that overriding this default value may result in unsupported + behavior. + :paramtype api_version: str + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + **kwargs: Any + ) -> None: + _endpoint = "{endpoint}" + self._config = NonResourceClientConfiguration( + credential=credential, subscription_id=subscription_id, base_url=base_url, **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), + AsyncARMAutoResourceProviderRegistrationPolicy(), + 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: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=_endpoint, policies=_policies, **kwargs) + + self._serialize = Serializer() + self._deserialize = Deserializer() + self._serialize.client_side_validation = False + self.non_resource_operations = NonResourceOperationsOperations( + 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.base_url", self._config.base_url, "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/azure-resource-manager-non-resource/azure/resourcemanager/nonresource/aio/_configuration.py b/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/azure/resourcemanager/nonresource/aio/_configuration.py new file mode 100644 index 00000000000..f4c5298cd1c --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/azure/resourcemanager/nonresource/aio/_configuration.py @@ -0,0 +1,68 @@ +# coding=utf-8 + +from typing import Any, TYPE_CHECKING + +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy + +from .._version import VERSION + +if TYPE_CHECKING: + from azure.core.credentials_async import AsyncTokenCredential + + +class NonResourceClientConfiguration: # pylint: disable=too-many-instance-attributes + """Configuration for NonResourceClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :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. + :type subscription_id: str + :param base_url: Service host. Default value is "https://management.azure.com". + :type base_url: str + :keyword api_version: The API version to use for this operation. Default value is + "2023-12-01-preview". Note that overriding this default value may result in unsupported + behavior. + :paramtype api_version: str + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + subscription_id: str, + base_url: str = "https://management.azure.com", + **kwargs: Any + ) -> None: + api_version: str = kwargs.pop("api_version", "2023-12-01-preview") + + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + + self.credential = credential + self.subscription_id = subscription_id + self.base_url = base_url + self.api_version = api_version + self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) + kwargs.setdefault("sdk_moniker", "resourcemanager-nonresource/{}".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 ARMHttpLoggingPolicy(**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") + if self.credential and not self.authentication_policy: + self.authentication_policy = AsyncARMChallengeAuthenticationPolicy( + self.credential, *self.credential_scopes, **kwargs + ) diff --git a/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/azure/resourcemanager/nonresource/aio/_patch.py b/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/azure/resourcemanager/nonresource/aio/_patch.py new file mode 100644 index 00000000000..8bcb627aa47 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/azure/resourcemanager/nonresource/aio/_patch.py @@ -0,0 +1,21 @@ +# 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. +# -------------------------------------------------------------------------- +"""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/azure-resource-manager-non-resource/azure/resourcemanager/nonresource/aio/operations/__init__.py b/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/azure/resourcemanager/nonresource/aio/operations/__init__.py new file mode 100644 index 00000000000..d76de3772a1 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/azure/resourcemanager/nonresource/aio/operations/__init__.py @@ -0,0 +1,19 @@ +# coding=utf-8 +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import NonResourceOperationsOperations # type: ignore + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "NonResourceOperationsOperations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/azure/resourcemanager/nonresource/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/azure/resourcemanager/nonresource/aio/operations/_operations.py new file mode 100644 index 00000000000..5ae28b46c65 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/azure/resourcemanager/nonresource/aio/operations/_operations.py @@ -0,0 +1,268 @@ +# coding=utf-8 +from io import IOBase +import json +import sys +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload + +from azure.core import AsyncPipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + StreamClosedError, + StreamConsumedError, + 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 azure.core.utils import case_insensitive_dict +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize +from ..._serialization import Deserializer, Serializer +from ...operations._operations import ( + build_non_resource_operations_create_request, + build_non_resource_operations_get_request, +) +from .._configuration import NonResourceClientConfiguration + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class NonResourceOperationsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.resourcemanager.nonresource.aio.NonResourceClient`'s + :attr:`non_resource_operations` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: NonResourceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get(self, location: str, parameter: str, **kwargs: Any) -> _models.NonResource: + """get. + + :param location: The location parameter. Required. + :type location: str + :param parameter: Another parameter. Required. + :type parameter: str + :return: NonResource. The NonResource is compatible with MutableMapping + :rtype: ~azure.resourcemanager.nonresource.models.NonResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.NonResource] = kwargs.pop("cls", None) + + _request = build_non_resource_operations_get_request( + location=location, + parameter=parameter, + 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.NonResource, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def create( + self, + location: str, + parameter: str, + body: _models.NonResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NonResource: + """create. + + :param location: The location parameter. Required. + :type location: str + :param parameter: Another parameter. Required. + :type parameter: str + :param body: The request body. Required. + :type body: ~azure.resourcemanager.nonresource.models.NonResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: NonResource. The NonResource is compatible with MutableMapping + :rtype: ~azure.resourcemanager.nonresource.models.NonResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create( + self, location: str, parameter: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.NonResource: + """create. + + :param location: The location parameter. Required. + :type location: str + :param parameter: Another parameter. Required. + :type parameter: str + :param body: The request body. Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: NonResource. The NonResource is compatible with MutableMapping + :rtype: ~azure.resourcemanager.nonresource.models.NonResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create( + self, location: str, parameter: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.NonResource: + """create. + + :param location: The location parameter. Required. + :type location: str + :param parameter: Another parameter. Required. + :type parameter: str + :param body: The request body. Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: NonResource. The NonResource is compatible with MutableMapping + :rtype: ~azure.resourcemanager.nonresource.models.NonResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create( + self, location: str, parameter: str, body: Union[_models.NonResource, JSON, IO[bytes]], **kwargs: Any + ) -> _models.NonResource: + """create. + + :param location: The location parameter. Required. + :type location: str + :param parameter: Another parameter. Required. + :type parameter: str + :param body: The request body. Is one of the following types: NonResource, JSON, IO[bytes] + Required. + :type body: ~azure.resourcemanager.nonresource.models.NonResource or JSON or IO[bytes] + :return: NonResource. The NonResource is compatible with MutableMapping + :rtype: ~azure.resourcemanager.nonresource.models.NonResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NonResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_non_resource_operations_create_request( + location=location, + parameter=parameter, + 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.NonResource, 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-resource-manager-non-resource/azure/resourcemanager/nonresource/aio/operations/_patch.py b/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/azure/resourcemanager/nonresource/aio/operations/_patch.py new file mode 100644 index 00000000000..8bcb627aa47 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/azure/resourcemanager/nonresource/aio/operations/_patch.py @@ -0,0 +1,21 @@ +# 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. +# -------------------------------------------------------------------------- +"""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/azure-resource-manager-non-resource/azure/resourcemanager/nonresource/models/__init__.py b/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/azure/resourcemanager/nonresource/models/__init__.py new file mode 100644 index 00000000000..2991aff6d37 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/azure/resourcemanager/nonresource/models/__init__.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + + +from ._models import ( # type: ignore + ErrorAdditionalInfo, + ErrorDetail, + ErrorResponse, + NonResource, +) +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "ErrorAdditionalInfo", + "ErrorDetail", + "ErrorResponse", + "NonResource", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/azure/resourcemanager/nonresource/models/_models.py b/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/azure/resourcemanager/nonresource/models/_models.py new file mode 100644 index 00000000000..6442aff229a --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/azure/resourcemanager/nonresource/models/_models.py @@ -0,0 +1,122 @@ +# coding=utf-8 +# pylint: disable=useless-super-delegation + +from typing import Any, List, Mapping, Optional, TYPE_CHECKING, overload + +from .. import _model_base +from .._model_base import rest_field + +if TYPE_CHECKING: + from .. import models as _models + + +class ErrorAdditionalInfo(_model_base.Model): + """The resource management error additional info. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: any + """ + + type: Optional[str] = rest_field(visibility=["read"]) + """The additional info type.""" + info: Optional[Any] = rest_field(visibility=["read"]) + """The additional info.""" + + +class ErrorDetail(_model_base.Model): + """The error detail. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: list[~azure.resourcemanager.nonresource.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: list[~azure.resourcemanager.nonresource.models.ErrorAdditionalInfo] + """ + + code: Optional[str] = rest_field(visibility=["read"]) + """The error code.""" + message: Optional[str] = rest_field(visibility=["read"]) + """The error message.""" + target: Optional[str] = rest_field(visibility=["read"]) + """The error target.""" + details: Optional[List["_models.ErrorDetail"]] = rest_field(visibility=["read"]) + """The error details.""" + additional_info: Optional[List["_models.ErrorAdditionalInfo"]] = rest_field( + name="additionalInfo", visibility=["read"] + ) + """The error additional info.""" + + +class ErrorResponse(_model_base.Model): + """Common error response for all Azure Resource Manager APIs to return error details for failed + operations. + + :ivar error: The error object. + :vartype error: ~azure.resourcemanager.nonresource.models.ErrorDetail + """ + + error: Optional["_models.ErrorDetail"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The error object.""" + + @overload + def __init__( + self, + *, + error: Optional["_models.ErrorDetail"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NonResource(_model_base.Model): + """Though this model has ``id``, ``name``, ``type`` properties, it is not a resource as it doesn't + extends ``Resource``. + + :ivar id: An id. + :vartype id: str + :ivar name: A name. + :vartype name: str + :ivar type: A type. + :vartype type: str + """ + + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """An id.""" + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A name.""" + type: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """A type.""" + + @overload + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + type: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) diff --git a/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/azure/resourcemanager/nonresource/models/_patch.py b/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/azure/resourcemanager/nonresource/models/_patch.py new file mode 100644 index 00000000000..8bcb627aa47 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/azure/resourcemanager/nonresource/models/_patch.py @@ -0,0 +1,21 @@ +# 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. +# -------------------------------------------------------------------------- +"""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/azure-resource-manager-non-resource/azure/resourcemanager/nonresource/operations/__init__.py b/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/azure/resourcemanager/nonresource/operations/__init__.py new file mode 100644 index 00000000000..d76de3772a1 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/azure/resourcemanager/nonresource/operations/__init__.py @@ -0,0 +1,19 @@ +# coding=utf-8 +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import NonResourceOperationsOperations # type: ignore + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "NonResourceOperationsOperations", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/azure/resourcemanager/nonresource/operations/_operations.py b/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/azure/resourcemanager/nonresource/operations/_operations.py new file mode 100644 index 00000000000..b940741edd0 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/azure/resourcemanager/nonresource/operations/_operations.py @@ -0,0 +1,327 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +from io import IOBase +import json +import sys +from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload + +from azure.core import PipelineClient +from azure.core.exceptions import ( + ClientAuthenticationError, + HttpResponseError, + ResourceExistsError, + ResourceNotFoundError, + ResourceNotModifiedError, + StreamClosedError, + StreamConsumedError, + 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 azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models +from .._configuration import NonResourceClientConfiguration +from .._model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize +from .._serialization import Deserializer, Serializer + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_non_resource_operations_get_request( # pylint: disable=name-too-long + location: str, parameter: 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}/providers/Microsoft.NonResource/locations/{location}/otherParameters/{parameter}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "location": _SERIALIZER.url("location", location, "str"), + "parameter": _SERIALIZER.url("parameter", parameter, "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_non_resource_operations_create_request( # pylint: disable=name-too-long + location: str, parameter: 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}/providers/Microsoft.NonResource/locations/{location}/otherParameters/{parameter}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "location": _SERIALIZER.url("location", location, "str"), + "parameter": _SERIALIZER.url("parameter", parameter, "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) + + +class NonResourceOperationsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.resourcemanager.nonresource.NonResourceClient`'s + :attr:`non_resource_operations` attribute. + """ + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: NonResourceClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get(self, location: str, parameter: str, **kwargs: Any) -> _models.NonResource: + """get. + + :param location: The location parameter. Required. + :type location: str + :param parameter: Another parameter. Required. + :type parameter: str + :return: NonResource. The NonResource is compatible with MutableMapping + :rtype: ~azure.resourcemanager.nonresource.models.NonResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.NonResource] = kwargs.pop("cls", None) + + _request = build_non_resource_operations_get_request( + location=location, + parameter=parameter, + 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.NonResource, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def create( + self, + location: str, + parameter: str, + body: _models.NonResource, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.NonResource: + """create. + + :param location: The location parameter. Required. + :type location: str + :param parameter: Another parameter. Required. + :type parameter: str + :param body: The request body. Required. + :type body: ~azure.resourcemanager.nonresource.models.NonResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: NonResource. The NonResource is compatible with MutableMapping + :rtype: ~azure.resourcemanager.nonresource.models.NonResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create( + self, location: str, parameter: str, body: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.NonResource: + """create. + + :param location: The location parameter. Required. + :type location: str + :param parameter: Another parameter. Required. + :type parameter: str + :param body: The request body. Required. + :type body: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: NonResource. The NonResource is compatible with MutableMapping + :rtype: ~azure.resourcemanager.nonresource.models.NonResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create( + self, location: str, parameter: str, body: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.NonResource: + """create. + + :param location: The location parameter. Required. + :type location: str + :param parameter: Another parameter. Required. + :type parameter: str + :param body: The request body. Required. + :type body: IO[bytes] + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: NonResource. The NonResource is compatible with MutableMapping + :rtype: ~azure.resourcemanager.nonresource.models.NonResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create( + self, location: str, parameter: str, body: Union[_models.NonResource, JSON, IO[bytes]], **kwargs: Any + ) -> _models.NonResource: + """create. + + :param location: The location parameter. Required. + :type location: str + :param parameter: Another parameter. Required. + :type parameter: str + :param body: The request body. Is one of the following types: NonResource, JSON, IO[bytes] + Required. + :type body: ~azure.resourcemanager.nonresource.models.NonResource or JSON or IO[bytes] + :return: NonResource. The NonResource is compatible with MutableMapping + :rtype: ~azure.resourcemanager.nonresource.models.NonResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.NonResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_non_resource_operations_create_request( + location=location, + parameter=parameter, + 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 = _failsafe_deserialize(_models.ErrorResponse, response.json()) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() + else: + deserialized = _deserialize(_models.NonResource, 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-resource-manager-non-resource/azure/resourcemanager/nonresource/operations/_patch.py b/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/azure/resourcemanager/nonresource/operations/_patch.py new file mode 100644 index 00000000000..8bcb627aa47 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/azure/resourcemanager/nonresource/operations/_patch.py @@ -0,0 +1,21 @@ +# 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. +# -------------------------------------------------------------------------- +"""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/azure-resource-manager-non-resource/azure/resourcemanager/nonresource/py.typed b/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/azure/resourcemanager/nonresource/py.typed new file mode 100644 index 00000000000..e5aff4f83af --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/azure/resourcemanager/nonresource/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/azure-resource-manager-non-resource/dev_requirements.txt b/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/dev_requirements.txt new file mode 100644 index 00000000000..05b9717a94f --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/dev_requirements.txt @@ -0,0 +1,5 @@ +-e ../../../tools/azure-sdk-tools +../../core/azure-core +../../identity/azure-identity +../../core/azure-mgmt-core +aiohttp \ No newline at end of file diff --git a/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/generated_tests/conftest.py b/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/generated_tests/conftest.py new file mode 100644 index 00000000000..d9a126c5276 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/generated_tests/conftest.py @@ -0,0 +1,29 @@ +# coding=utf-8 +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() + + +# For security, please avoid record sensitive identity information in recordings +@pytest.fixture(scope="session", autouse=True) +def add_sanitizers(test_proxy): + nonresource_subscription_id = os.environ.get("AZURE_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000") + nonresource_tenant_id = os.environ.get("AZURE_TENANT_ID", "00000000-0000-0000-0000-000000000000") + nonresource_client_id = os.environ.get("AZURE_CLIENT_ID", "00000000-0000-0000-0000-000000000000") + nonresource_client_secret = os.environ.get("AZURE_CLIENT_SECRET", "00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=nonresource_subscription_id, value="00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=nonresource_tenant_id, value="00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=nonresource_client_id, value="00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=nonresource_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/azure-resource-manager-non-resource/generated_tests/test_non_resource_non_resource_operations_operations.py b/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/generated_tests/test_non_resource_non_resource_operations_operations.py new file mode 100644 index 00000000000..046d3943a3a --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/generated_tests/test_non_resource_non_resource_operations_operations.py @@ -0,0 +1,36 @@ +# coding=utf-8 +import pytest +from azure.resourcemanager.nonresource import NonResourceClient + +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 TestNonResourceNonResourceOperationsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(NonResourceClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_non_resource_operations_get(self, resource_group): + response = self.client.non_resource_operations.get( + location="str", + parameter="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_non_resource_operations_create(self, resource_group): + response = self.client.non_resource_operations.create( + location="str", + parameter="str", + body={"id": "str", "name": "str", "type": "str"}, + ) + + # please add some check logic here by yourself + # ... diff --git a/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/generated_tests/test_non_resource_non_resource_operations_operations_async.py b/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/generated_tests/test_non_resource_non_resource_operations_operations_async.py new file mode 100644 index 00000000000..5a3074b9adf --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/generated_tests/test_non_resource_non_resource_operations_operations_async.py @@ -0,0 +1,37 @@ +# coding=utf-8 +import pytest +from azure.resourcemanager.nonresource.aio import NonResourceClient + +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 TestNonResourceNonResourceOperationsOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(NonResourceClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_non_resource_operations_get(self, resource_group): + response = await self.client.non_resource_operations.get( + location="str", + parameter="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_non_resource_operations_create(self, resource_group): + response = await self.client.non_resource_operations.create( + location="str", + parameter="str", + body={"id": "str", "name": "str", "type": "str"}, + ) + + # please add some check logic here by yourself + # ... diff --git a/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/setup.py b/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/setup.py new file mode 100644 index 00000000000..5e83f4b6e46 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/azure-resource-manager-non-resource/setup.py @@ -0,0 +1,65 @@ +# coding=utf-8 + + +import os +import re +from setuptools import setup, find_packages + + +PACKAGE_NAME = "azure-resourcemanager-nonresource" +PACKAGE_PPRINT_NAME = "Azure Resourcemanager Nonresource" + +# 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 Corporation {} 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", + # Exclude packages that will be covered by PEP420 or nspkg + "azure", + "azure.resourcemanager", + ] + ), + include_package_data=True, + package_data={ + "azure.resourcemanager.nonresource": ["py.typed"], + }, + install_requires=[ + "isodate>=0.6.1", + "azure-mgmt-core>=1.3.2", + "typing-extensions>=4.6.0", + ], + python_requires=">=3.8", +) diff --git a/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/_client.py b/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/_client.py index 50e9158f6f1..c3e95c1e9b6 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/_client.py +++ b/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/_client.py @@ -94,7 +94,7 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), } diff --git a/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/aio/_client.py b/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/aio/_client.py index 7e02fb1703c..82760e2fb28 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/aio/_client.py +++ b/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/aio/_client.py @@ -96,7 +96,7 @@ def send_request( request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), } diff --git a/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/aio/operations/_operations.py index 72c5376880d..4a41acc6cde 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/aio/operations/_operations.py @@ -104,7 +104,7 @@ async def eight(self, **kwargs: Any) -> None: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -167,7 +167,7 @@ async def three(self, **kwargs: Any) -> None: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -212,7 +212,7 @@ async def four(self, **kwargs: Any) -> None: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -275,7 +275,7 @@ async def five(self, **kwargs: Any) -> None: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -320,7 +320,7 @@ async def six(self, **kwargs: Any) -> None: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -368,7 +368,7 @@ async def one(self, **kwargs: Any) -> None: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -413,7 +413,7 @@ async def two(self, **kwargs: Any) -> None: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -476,7 +476,7 @@ async def seven(self, **kwargs: Any) -> None: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -539,7 +539,7 @@ async def nine(self, **kwargs: Any) -> None: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) diff --git a/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/operations/_operations.py b/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/operations/_operations.py index d7ce56eaecf..9c49e5f0def 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/operations/_operations.py @@ -158,7 +158,7 @@ def eight(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-s params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -221,7 +221,7 @@ def three(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-s params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -266,7 +266,7 @@ def four(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-st params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -329,7 +329,7 @@ def five(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-st params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -374,7 +374,7 @@ def six(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-sta params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -422,7 +422,7 @@ def one(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-sta params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -467,7 +467,7 @@ def two(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-sta params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -530,7 +530,7 @@ def seven(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-s params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -593,7 +593,7 @@ def nine(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-st params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) diff --git a/packages/typespec-python/test/azure/generated/client-structure-multiclient/client/structure/multiclient/_client.py b/packages/typespec-python/test/azure/generated/client-structure-multiclient/client/structure/multiclient/_client.py index 898835a1f53..0ec5e34a6ca 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-multiclient/client/structure/multiclient/_client.py +++ b/packages/typespec-python/test/azure/generated/client-structure-multiclient/client/structure/multiclient/_client.py @@ -74,7 +74,7 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), } @@ -152,7 +152,7 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), } diff --git a/packages/typespec-python/test/azure/generated/client-structure-multiclient/client/structure/multiclient/_operations/_operations.py b/packages/typespec-python/test/azure/generated/client-structure-multiclient/client/structure/multiclient/_operations/_operations.py index 9dfcab01a56..cffd9534765 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-multiclient/client/structure/multiclient/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/client-structure-multiclient/client/structure/multiclient/_operations/_operations.py @@ -98,7 +98,7 @@ def renamed_one(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-re params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -143,7 +143,7 @@ def renamed_three(self, **kwargs: Any) -> None: # pylint: disable=inconsistent- params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -188,7 +188,7 @@ def renamed_five(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-r params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -236,7 +236,7 @@ def renamed_two(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-re params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -281,7 +281,7 @@ def renamed_four(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-r params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -326,7 +326,7 @@ def renamed_six(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-re params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) diff --git a/packages/typespec-python/test/azure/generated/client-structure-multiclient/client/structure/multiclient/aio/_client.py b/packages/typespec-python/test/azure/generated/client-structure-multiclient/client/structure/multiclient/aio/_client.py index ebe52f4953c..c8d97f94dc7 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-multiclient/client/structure/multiclient/aio/_client.py +++ b/packages/typespec-python/test/azure/generated/client-structure-multiclient/client/structure/multiclient/aio/_client.py @@ -76,7 +76,7 @@ def send_request( request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), } @@ -156,7 +156,7 @@ def send_request( request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), } diff --git a/packages/typespec-python/test/azure/generated/client-structure-multiclient/client/structure/multiclient/aio/_operations/_operations.py b/packages/typespec-python/test/azure/generated/client-structure-multiclient/client/structure/multiclient/aio/_operations/_operations.py index 36cfdb2a7f2..92d427dba83 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-multiclient/client/structure/multiclient/aio/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/client-structure-multiclient/client/structure/multiclient/aio/_operations/_operations.py @@ -61,7 +61,7 @@ async def renamed_one(self, **kwargs: Any) -> None: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -106,7 +106,7 @@ async def renamed_three(self, **kwargs: Any) -> None: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -151,7 +151,7 @@ async def renamed_five(self, **kwargs: Any) -> None: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -199,7 +199,7 @@ async def renamed_two(self, **kwargs: Any) -> None: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -244,7 +244,7 @@ async def renamed_four(self, **kwargs: Any) -> None: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -289,7 +289,7 @@ async def renamed_six(self, **kwargs: Any) -> None: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) diff --git a/packages/typespec-python/test/azure/generated/client-structure-renamedoperation/client/structure/renamedoperation/_client.py b/packages/typespec-python/test/azure/generated/client-structure-renamedoperation/client/structure/renamedoperation/_client.py index 45cff534428..4d899d81b1d 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-renamedoperation/client/structure/renamedoperation/_client.py +++ b/packages/typespec-python/test/azure/generated/client-structure-renamedoperation/client/structure/renamedoperation/_client.py @@ -79,7 +79,7 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), } diff --git a/packages/typespec-python/test/azure/generated/client-structure-renamedoperation/client/structure/renamedoperation/aio/_client.py b/packages/typespec-python/test/azure/generated/client-structure-renamedoperation/client/structure/renamedoperation/aio/_client.py index b180311c75d..54d4845b128 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-renamedoperation/client/structure/renamedoperation/aio/_client.py +++ b/packages/typespec-python/test/azure/generated/client-structure-renamedoperation/client/structure/renamedoperation/aio/_client.py @@ -81,7 +81,7 @@ def send_request( request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), } diff --git a/packages/typespec-python/test/azure/generated/client-structure-renamedoperation/client/structure/renamedoperation/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/client-structure-renamedoperation/client/structure/renamedoperation/aio/operations/_operations.py index 76b2194d1fe..248ee3396f1 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-renamedoperation/client/structure/renamedoperation/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/client-structure-renamedoperation/client/structure/renamedoperation/aio/operations/_operations.py @@ -79,7 +79,7 @@ async def renamed_two(self, **kwargs: Any) -> None: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -124,7 +124,7 @@ async def renamed_four(self, **kwargs: Any) -> None: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -169,7 +169,7 @@ async def renamed_six(self, **kwargs: Any) -> None: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -217,7 +217,7 @@ async def renamed_one(self, **kwargs: Any) -> None: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -262,7 +262,7 @@ async def renamed_three(self, **kwargs: Any) -> None: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -307,7 +307,7 @@ async def renamed_five(self, **kwargs: Any) -> None: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) diff --git a/packages/typespec-python/test/azure/generated/client-structure-renamedoperation/client/structure/renamedoperation/operations/_operations.py b/packages/typespec-python/test/azure/generated/client-structure-renamedoperation/client/structure/renamedoperation/operations/_operations.py index fc03bd64e48..b2b0c73e627 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-renamedoperation/client/structure/renamedoperation/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/client-structure-renamedoperation/client/structure/renamedoperation/operations/_operations.py @@ -115,7 +115,7 @@ def renamed_two(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-re params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -160,7 +160,7 @@ def renamed_four(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-r params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -205,7 +205,7 @@ def renamed_six(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-re params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -253,7 +253,7 @@ def renamed_one(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-re params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -298,7 +298,7 @@ def renamed_three(self, **kwargs: Any) -> None: # pylint: disable=inconsistent- params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -343,7 +343,7 @@ def renamed_five(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-r params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) diff --git a/packages/typespec-python/test/azure/generated/client-structure-twooperationgroup/client/structure/twooperationgroup/_client.py b/packages/typespec-python/test/azure/generated/client-structure-twooperationgroup/client/structure/twooperationgroup/_client.py index 4b772d1f221..84f5b6b086f 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-twooperationgroup/client/structure/twooperationgroup/_client.py +++ b/packages/typespec-python/test/azure/generated/client-structure-twooperationgroup/client/structure/twooperationgroup/_client.py @@ -80,7 +80,7 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), } diff --git a/packages/typespec-python/test/azure/generated/client-structure-twooperationgroup/client/structure/twooperationgroup/aio/_client.py b/packages/typespec-python/test/azure/generated/client-structure-twooperationgroup/client/structure/twooperationgroup/aio/_client.py index 9350cc07de8..38f2b66bdcb 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-twooperationgroup/client/structure/twooperationgroup/aio/_client.py +++ b/packages/typespec-python/test/azure/generated/client-structure-twooperationgroup/client/structure/twooperationgroup/aio/_client.py @@ -82,7 +82,7 @@ def send_request( request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), } diff --git a/packages/typespec-python/test/azure/generated/client-structure-twooperationgroup/client/structure/twooperationgroup/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/client-structure-twooperationgroup/client/structure/twooperationgroup/aio/operations/_operations.py index f27039def30..022c2d5182b 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-twooperationgroup/client/structure/twooperationgroup/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/client-structure-twooperationgroup/client/structure/twooperationgroup/aio/operations/_operations.py @@ -77,7 +77,7 @@ async def one(self, **kwargs: Any) -> None: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -122,7 +122,7 @@ async def three(self, **kwargs: Any) -> None: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -167,7 +167,7 @@ async def four(self, **kwargs: Any) -> None: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -230,7 +230,7 @@ async def two(self, **kwargs: Any) -> None: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -275,7 +275,7 @@ async def five(self, **kwargs: Any) -> None: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -320,7 +320,7 @@ async def six(self, **kwargs: Any) -> None: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) diff --git a/packages/typespec-python/test/azure/generated/client-structure-twooperationgroup/client/structure/twooperationgroup/operations/_operations.py b/packages/typespec-python/test/azure/generated/client-structure-twooperationgroup/client/structure/twooperationgroup/operations/_operations.py index e9bf032e3da..6b285d48b5c 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-twooperationgroup/client/structure/twooperationgroup/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/client-structure-twooperationgroup/client/structure/twooperationgroup/operations/_operations.py @@ -114,7 +114,7 @@ def one(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-sta params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -159,7 +159,7 @@ def three(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-s params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -204,7 +204,7 @@ def four(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-st params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -267,7 +267,7 @@ def two(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-sta params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -312,7 +312,7 @@ def five(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-st params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -357,7 +357,7 @@ def six(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-sta params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) diff --git a/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/responsebody/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/responsebody/aio/operations/_operations.py index e6eaa72358d..fb221e78adf 100644 --- a/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/responsebody/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/responsebody/aio/operations/_operations.py @@ -329,7 +329,7 @@ async def base64_url(self, **kwargs: Any) -> bytes: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(bytes, response.json(), format="base64") + deserialized = _deserialize(bytes, response.json(), format="base64url") if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/responsebody/operations/_operations.py b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/responsebody/operations/_operations.py index 145182e643e..35e2d0205a8 100644 --- a/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/responsebody/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/encode-bytes/encode/bytes/responsebody/operations/_operations.py @@ -396,7 +396,7 @@ def base64_url(self, **kwargs: Any) -> bytes: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(bytes, response.json(), format="base64") + deserialized = _deserialize(bytes, response.json(), format="base64url") if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/headasbooleanfalse/generated_tests/test_visibility.py b/packages/typespec-python/test/azure/generated/headasbooleanfalse/generated_tests/test_visibility.py index 337f1f994a7..889908e6993 100644 --- a/packages/typespec-python/test/azure/generated/headasbooleanfalse/generated_tests/test_visibility.py +++ b/packages/typespec-python/test/azure/generated/headasbooleanfalse/generated_tests/test_visibility.py @@ -11,7 +11,8 @@ class TestVisibility(VisibilityClientTestBase): def test_get_model(self, visibility_endpoint): client = self.create_client(endpoint=visibility_endpoint) response = client.get_model( - input={"createProp": ["str"], "deleteProp": bool, "queryProp": 0, "readProp": "str", "updateProp": [0]}, + input={"createProp": ["str"], "deleteProp": bool, "readProp": "str", "updateProp": [0]}, + query_prop=0, ) # please add some check logic here by yourself @@ -22,7 +23,8 @@ def test_get_model(self, visibility_endpoint): def test_head_model(self, visibility_endpoint): client = self.create_client(endpoint=visibility_endpoint) response = client.head_model( - input={"createProp": ["str"], "deleteProp": bool, "queryProp": 0, "readProp": "str", "updateProp": [0]}, + input={"createProp": ["str"], "deleteProp": bool, "readProp": "str", "updateProp": [0]}, + query_prop=0, ) # please add some check logic here by yourself @@ -33,7 +35,7 @@ def test_head_model(self, visibility_endpoint): def test_put_model(self, visibility_endpoint): client = self.create_client(endpoint=visibility_endpoint) response = client.put_model( - input={"createProp": ["str"], "deleteProp": bool, "queryProp": 0, "readProp": "str", "updateProp": [0]}, + input={"createProp": ["str"], "deleteProp": bool, "readProp": "str", "updateProp": [0]}, ) # please add some check logic here by yourself @@ -44,7 +46,7 @@ def test_put_model(self, visibility_endpoint): def test_patch_model(self, visibility_endpoint): client = self.create_client(endpoint=visibility_endpoint) response = client.patch_model( - input={"createProp": ["str"], "deleteProp": bool, "queryProp": 0, "readProp": "str", "updateProp": [0]}, + input={"createProp": ["str"], "deleteProp": bool, "readProp": "str", "updateProp": [0]}, ) # please add some check logic here by yourself @@ -55,7 +57,7 @@ def test_patch_model(self, visibility_endpoint): def test_post_model(self, visibility_endpoint): client = self.create_client(endpoint=visibility_endpoint) response = client.post_model( - input={"createProp": ["str"], "deleteProp": bool, "queryProp": 0, "readProp": "str", "updateProp": [0]}, + input={"createProp": ["str"], "deleteProp": bool, "readProp": "str", "updateProp": [0]}, ) # please add some check logic here by yourself @@ -66,7 +68,7 @@ def test_post_model(self, visibility_endpoint): def test_delete_model(self, visibility_endpoint): client = self.create_client(endpoint=visibility_endpoint) response = client.delete_model( - input={"createProp": ["str"], "deleteProp": bool, "queryProp": 0, "readProp": "str", "updateProp": [0]}, + input={"createProp": ["str"], "deleteProp": bool, "readProp": "str", "updateProp": [0]}, ) # please add some check logic here by yourself diff --git a/packages/typespec-python/test/azure/generated/headasbooleanfalse/generated_tests/test_visibility_async.py b/packages/typespec-python/test/azure/generated/headasbooleanfalse/generated_tests/test_visibility_async.py index 5984e18954f..1461bd28e38 100644 --- a/packages/typespec-python/test/azure/generated/headasbooleanfalse/generated_tests/test_visibility_async.py +++ b/packages/typespec-python/test/azure/generated/headasbooleanfalse/generated_tests/test_visibility_async.py @@ -12,7 +12,8 @@ class TestVisibilityAsync(VisibilityClientTestBaseAsync): async def test_get_model(self, visibility_endpoint): client = self.create_async_client(endpoint=visibility_endpoint) response = await client.get_model( - input={"createProp": ["str"], "deleteProp": bool, "queryProp": 0, "readProp": "str", "updateProp": [0]}, + input={"createProp": ["str"], "deleteProp": bool, "readProp": "str", "updateProp": [0]}, + query_prop=0, ) # please add some check logic here by yourself @@ -23,7 +24,8 @@ async def test_get_model(self, visibility_endpoint): async def test_head_model(self, visibility_endpoint): client = self.create_async_client(endpoint=visibility_endpoint) response = await client.head_model( - input={"createProp": ["str"], "deleteProp": bool, "queryProp": 0, "readProp": "str", "updateProp": [0]}, + input={"createProp": ["str"], "deleteProp": bool, "readProp": "str", "updateProp": [0]}, + query_prop=0, ) # please add some check logic here by yourself @@ -34,7 +36,7 @@ async def test_head_model(self, visibility_endpoint): async def test_put_model(self, visibility_endpoint): client = self.create_async_client(endpoint=visibility_endpoint) response = await client.put_model( - input={"createProp": ["str"], "deleteProp": bool, "queryProp": 0, "readProp": "str", "updateProp": [0]}, + input={"createProp": ["str"], "deleteProp": bool, "readProp": "str", "updateProp": [0]}, ) # please add some check logic here by yourself @@ -45,7 +47,7 @@ async def test_put_model(self, visibility_endpoint): async def test_patch_model(self, visibility_endpoint): client = self.create_async_client(endpoint=visibility_endpoint) response = await client.patch_model( - input={"createProp": ["str"], "deleteProp": bool, "queryProp": 0, "readProp": "str", "updateProp": [0]}, + input={"createProp": ["str"], "deleteProp": bool, "readProp": "str", "updateProp": [0]}, ) # please add some check logic here by yourself @@ -56,7 +58,7 @@ async def test_patch_model(self, visibility_endpoint): async def test_post_model(self, visibility_endpoint): client = self.create_async_client(endpoint=visibility_endpoint) response = await client.post_model( - input={"createProp": ["str"], "deleteProp": bool, "queryProp": 0, "readProp": "str", "updateProp": [0]}, + input={"createProp": ["str"], "deleteProp": bool, "readProp": "str", "updateProp": [0]}, ) # please add some check logic here by yourself @@ -67,7 +69,7 @@ async def test_post_model(self, visibility_endpoint): async def test_delete_model(self, visibility_endpoint): client = self.create_async_client(endpoint=visibility_endpoint) response = await client.delete_model( - input={"createProp": ["str"], "deleteProp": bool, "queryProp": 0, "readProp": "str", "updateProp": [0]}, + input={"createProp": ["str"], "deleteProp": bool, "readProp": "str", "updateProp": [0]}, ) # please add some check logic here by yourself diff --git a/packages/typespec-python/test/azure/generated/headasbooleanfalse/headasbooleanfalse/_operations/_operations.py b/packages/typespec-python/test/azure/generated/headasbooleanfalse/headasbooleanfalse/_operations/_operations.py index 2b388a2b992..4b23c1df4d9 100644 --- a/packages/typespec-python/test/azure/generated/headasbooleanfalse/headasbooleanfalse/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/headasbooleanfalse/headasbooleanfalse/_operations/_operations.py @@ -36,8 +36,9 @@ _SERIALIZER.client_side_validation = False -def build_visibility_get_model_request(**kwargs: Any) -> HttpRequest: +def build_visibility_get_model_request(*, query_prop: int, **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)) accept = _headers.pop("Accept", "application/json") @@ -45,26 +46,33 @@ def build_visibility_get_model_request(**kwargs: Any) -> HttpRequest: # Construct URL _url = "/type/model/visibility" + # Construct parameters + _params["queryProp"] = _SERIALIZER.query("query_prop", query_prop, "int") + # 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="GET", url=_url, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_visibility_head_model_request(**kwargs: Any) -> HttpRequest: +def build_visibility_head_model_request(*, query_prop: int, **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)) # Construct URL _url = "/type/model/visibility" + # Construct parameters + _params["queryProp"] = _SERIALIZER.query("query_prop", query_prop, "int") + # Construct headers if content_type is not None: _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - return HttpRequest(method="HEAD", url=_url, headers=_headers, **kwargs) + return HttpRequest(method="HEAD", url=_url, params=_params, headers=_headers, **kwargs) def build_visibility_put_model_request(**kwargs: Any) -> HttpRequest: @@ -144,12 +152,14 @@ class VisibilityClientOperationsMixin(VisibilityClientMixinABC): @overload def get_model( - self, input: _models.VisibilityModel, *, content_type: str = "application/json", **kwargs: Any + self, input: _models.VisibilityModel, *, query_prop: int, content_type: str = "application/json", **kwargs: Any ) -> _models.VisibilityModel: """get_model. :param input: Required. :type input: ~headasbooleanfalse.models.VisibilityModel + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -160,12 +170,14 @@ def get_model( @overload def get_model( - self, input: JSON, *, content_type: str = "application/json", **kwargs: Any + self, input: JSON, *, query_prop: int, content_type: str = "application/json", **kwargs: Any ) -> _models.VisibilityModel: """get_model. :param input: Required. :type input: JSON + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -176,12 +188,14 @@ def get_model( @overload def get_model( - self, input: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + self, input: IO[bytes], *, query_prop: int, content_type: str = "application/json", **kwargs: Any ) -> _models.VisibilityModel: """get_model. :param input: Required. :type input: IO[bytes] + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -192,12 +206,14 @@ def get_model( @distributed_trace def get_model( - self, input: Union[_models.VisibilityModel, JSON, IO[bytes]], **kwargs: Any + self, input: Union[_models.VisibilityModel, JSON, IO[bytes]], *, query_prop: int, **kwargs: Any ) -> _models.VisibilityModel: """get_model. :param input: Is one of the following types: VisibilityModel, JSON, IO[bytes] Required. :type input: ~headasbooleanfalse.models.VisibilityModel or JSON or IO[bytes] + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :return: VisibilityModel. The VisibilityModel is compatible with MutableMapping :rtype: ~headasbooleanfalse.models.VisibilityModel :raises ~azure.core.exceptions.HttpResponseError: @@ -224,6 +240,7 @@ def get_model( _content = json.dumps(input, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_visibility_get_model_request( + query_prop=query_prop, content_type=content_type, content=_content, headers=_headers, @@ -262,12 +279,14 @@ def get_model( @overload def head_model( - self, input: _models.VisibilityModel, *, content_type: str = "application/json", **kwargs: Any + self, input: _models.VisibilityModel, *, query_prop: int, content_type: str = "application/json", **kwargs: Any ) -> None: """head_model. :param input: Required. :type input: ~headasbooleanfalse.models.VisibilityModel + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -277,11 +296,15 @@ def head_model( """ @overload - def head_model(self, input: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + def head_model( + self, input: JSON, *, query_prop: int, content_type: str = "application/json", **kwargs: Any + ) -> None: """head_model. :param input: Required. :type input: JSON + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -291,11 +314,15 @@ def head_model(self, input: JSON, *, content_type: str = "application/json", **k """ @overload - def head_model(self, input: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + def head_model( + self, input: IO[bytes], *, query_prop: int, content_type: str = "application/json", **kwargs: Any + ) -> None: """head_model. :param input: Required. :type input: IO[bytes] + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -306,12 +333,14 @@ def head_model(self, input: IO[bytes], *, content_type: str = "application/json" @distributed_trace def head_model( # pylint: disable=inconsistent-return-statements - self, input: Union[_models.VisibilityModel, JSON, IO[bytes]], **kwargs: Any + self, input: Union[_models.VisibilityModel, JSON, IO[bytes]], *, query_prop: int, **kwargs: Any ) -> None: """head_model. :param input: Is one of the following types: VisibilityModel, JSON, IO[bytes] Required. :type input: ~headasbooleanfalse.models.VisibilityModel or JSON or IO[bytes] + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :return: None :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -338,6 +367,7 @@ def head_model( # pylint: disable=inconsistent-return-statements _content = json.dumps(input, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_visibility_head_model_request( + query_prop=query_prop, content_type=content_type, content=_content, headers=_headers, diff --git a/packages/typespec-python/test/azure/generated/headasbooleanfalse/headasbooleanfalse/aio/_operations/_operations.py b/packages/typespec-python/test/azure/generated/headasbooleanfalse/headasbooleanfalse/aio/_operations/_operations.py index ec97d254e05..15ef393842b 100644 --- a/packages/typespec-python/test/azure/generated/headasbooleanfalse/headasbooleanfalse/aio/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/headasbooleanfalse/headasbooleanfalse/aio/_operations/_operations.py @@ -46,12 +46,14 @@ class VisibilityClientOperationsMixin(VisibilityClientMixinABC): @overload async def get_model( - self, input: _models.VisibilityModel, *, content_type: str = "application/json", **kwargs: Any + self, input: _models.VisibilityModel, *, query_prop: int, content_type: str = "application/json", **kwargs: Any ) -> _models.VisibilityModel: """get_model. :param input: Required. :type input: ~headasbooleanfalse.models.VisibilityModel + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -62,12 +64,14 @@ async def get_model( @overload async def get_model( - self, input: JSON, *, content_type: str = "application/json", **kwargs: Any + self, input: JSON, *, query_prop: int, content_type: str = "application/json", **kwargs: Any ) -> _models.VisibilityModel: """get_model. :param input: Required. :type input: JSON + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -78,12 +82,14 @@ async def get_model( @overload async def get_model( - self, input: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + self, input: IO[bytes], *, query_prop: int, content_type: str = "application/json", **kwargs: Any ) -> _models.VisibilityModel: """get_model. :param input: Required. :type input: IO[bytes] + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -94,12 +100,14 @@ async def get_model( @distributed_trace_async async def get_model( - self, input: Union[_models.VisibilityModel, JSON, IO[bytes]], **kwargs: Any + self, input: Union[_models.VisibilityModel, JSON, IO[bytes]], *, query_prop: int, **kwargs: Any ) -> _models.VisibilityModel: """get_model. :param input: Is one of the following types: VisibilityModel, JSON, IO[bytes] Required. :type input: ~headasbooleanfalse.models.VisibilityModel or JSON or IO[bytes] + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :return: VisibilityModel. The VisibilityModel is compatible with MutableMapping :rtype: ~headasbooleanfalse.models.VisibilityModel :raises ~azure.core.exceptions.HttpResponseError: @@ -126,6 +134,7 @@ async def get_model( _content = json.dumps(input, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_visibility_get_model_request( + query_prop=query_prop, content_type=content_type, content=_content, headers=_headers, @@ -164,12 +173,14 @@ async def get_model( @overload async def head_model( - self, input: _models.VisibilityModel, *, content_type: str = "application/json", **kwargs: Any + self, input: _models.VisibilityModel, *, query_prop: int, content_type: str = "application/json", **kwargs: Any ) -> None: """head_model. :param input: Required. :type input: ~headasbooleanfalse.models.VisibilityModel + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -179,11 +190,15 @@ async def head_model( """ @overload - async def head_model(self, input: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + async def head_model( + self, input: JSON, *, query_prop: int, content_type: str = "application/json", **kwargs: Any + ) -> None: """head_model. :param input: Required. :type input: JSON + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -193,11 +208,15 @@ async def head_model(self, input: JSON, *, content_type: str = "application/json """ @overload - async def head_model(self, input: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + async def head_model( + self, input: IO[bytes], *, query_prop: int, content_type: str = "application/json", **kwargs: Any + ) -> None: """head_model. :param input: Required. :type input: IO[bytes] + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -207,11 +226,15 @@ async def head_model(self, input: IO[bytes], *, content_type: str = "application """ @distributed_trace_async - async def head_model(self, input: Union[_models.VisibilityModel, JSON, IO[bytes]], **kwargs: Any) -> None: + async def head_model( + self, input: Union[_models.VisibilityModel, JSON, IO[bytes]], *, query_prop: int, **kwargs: Any + ) -> None: """head_model. :param input: Is one of the following types: VisibilityModel, JSON, IO[bytes] Required. :type input: ~headasbooleanfalse.models.VisibilityModel or JSON or IO[bytes] + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :return: None :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -238,6 +261,7 @@ async def head_model(self, input: Union[_models.VisibilityModel, JSON, IO[bytes] _content = json.dumps(input, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_visibility_head_model_request( + query_prop=query_prop, content_type=content_type, content=_content, headers=_headers, diff --git a/packages/typespec-python/test/azure/generated/headasbooleanfalse/headasbooleanfalse/models/_models.py b/packages/typespec-python/test/azure/generated/headasbooleanfalse/headasbooleanfalse/models/_models.py index e9e648696dc..a302369b8a6 100644 --- a/packages/typespec-python/test/azure/generated/headasbooleanfalse/headasbooleanfalse/models/_models.py +++ b/packages/typespec-python/test/azure/generated/headasbooleanfalse/headasbooleanfalse/models/_models.py @@ -27,8 +27,6 @@ class VisibilityModel(_model_base.Model): :ivar read_prop: Required string, illustrating a readonly property. Required. :vartype read_prop: str - :ivar query_prop: Required int32, illustrating a query property. Required. - :vartype query_prop: int :ivar create_prop: Required string[], illustrating a create property. Required. :vartype create_prop: list[str] :ivar update_prop: Required int32[], illustrating a update property. Required. @@ -39,8 +37,6 @@ class VisibilityModel(_model_base.Model): read_prop: str = rest_field(name="readProp", visibility=["read"]) """Required string, illustrating a readonly property. Required.""" - query_prop: int = rest_field(name="queryProp", visibility=["query"]) - """Required int32, illustrating a query property. Required.""" create_prop: List[str] = rest_field(name="createProp", visibility=["create"]) """Required string[], illustrating a create property. Required.""" update_prop: List[int] = rest_field(name="updateProp", visibility=["update"]) @@ -52,7 +48,6 @@ class VisibilityModel(_model_base.Model): def __init__( self, *, - query_prop: int, create_prop: List[str], update_prop: List[int], delete_prop: bool, diff --git a/packages/typespec-python/test/azure/generated/headasbooleantrue/generated_tests/test_visibility.py b/packages/typespec-python/test/azure/generated/headasbooleantrue/generated_tests/test_visibility.py index 337f1f994a7..889908e6993 100644 --- a/packages/typespec-python/test/azure/generated/headasbooleantrue/generated_tests/test_visibility.py +++ b/packages/typespec-python/test/azure/generated/headasbooleantrue/generated_tests/test_visibility.py @@ -11,7 +11,8 @@ class TestVisibility(VisibilityClientTestBase): def test_get_model(self, visibility_endpoint): client = self.create_client(endpoint=visibility_endpoint) response = client.get_model( - input={"createProp": ["str"], "deleteProp": bool, "queryProp": 0, "readProp": "str", "updateProp": [0]}, + input={"createProp": ["str"], "deleteProp": bool, "readProp": "str", "updateProp": [0]}, + query_prop=0, ) # please add some check logic here by yourself @@ -22,7 +23,8 @@ def test_get_model(self, visibility_endpoint): def test_head_model(self, visibility_endpoint): client = self.create_client(endpoint=visibility_endpoint) response = client.head_model( - input={"createProp": ["str"], "deleteProp": bool, "queryProp": 0, "readProp": "str", "updateProp": [0]}, + input={"createProp": ["str"], "deleteProp": bool, "readProp": "str", "updateProp": [0]}, + query_prop=0, ) # please add some check logic here by yourself @@ -33,7 +35,7 @@ def test_head_model(self, visibility_endpoint): def test_put_model(self, visibility_endpoint): client = self.create_client(endpoint=visibility_endpoint) response = client.put_model( - input={"createProp": ["str"], "deleteProp": bool, "queryProp": 0, "readProp": "str", "updateProp": [0]}, + input={"createProp": ["str"], "deleteProp": bool, "readProp": "str", "updateProp": [0]}, ) # please add some check logic here by yourself @@ -44,7 +46,7 @@ def test_put_model(self, visibility_endpoint): def test_patch_model(self, visibility_endpoint): client = self.create_client(endpoint=visibility_endpoint) response = client.patch_model( - input={"createProp": ["str"], "deleteProp": bool, "queryProp": 0, "readProp": "str", "updateProp": [0]}, + input={"createProp": ["str"], "deleteProp": bool, "readProp": "str", "updateProp": [0]}, ) # please add some check logic here by yourself @@ -55,7 +57,7 @@ def test_patch_model(self, visibility_endpoint): def test_post_model(self, visibility_endpoint): client = self.create_client(endpoint=visibility_endpoint) response = client.post_model( - input={"createProp": ["str"], "deleteProp": bool, "queryProp": 0, "readProp": "str", "updateProp": [0]}, + input={"createProp": ["str"], "deleteProp": bool, "readProp": "str", "updateProp": [0]}, ) # please add some check logic here by yourself @@ -66,7 +68,7 @@ def test_post_model(self, visibility_endpoint): def test_delete_model(self, visibility_endpoint): client = self.create_client(endpoint=visibility_endpoint) response = client.delete_model( - input={"createProp": ["str"], "deleteProp": bool, "queryProp": 0, "readProp": "str", "updateProp": [0]}, + input={"createProp": ["str"], "deleteProp": bool, "readProp": "str", "updateProp": [0]}, ) # please add some check logic here by yourself diff --git a/packages/typespec-python/test/azure/generated/headasbooleantrue/generated_tests/test_visibility_async.py b/packages/typespec-python/test/azure/generated/headasbooleantrue/generated_tests/test_visibility_async.py index 5984e18954f..1461bd28e38 100644 --- a/packages/typespec-python/test/azure/generated/headasbooleantrue/generated_tests/test_visibility_async.py +++ b/packages/typespec-python/test/azure/generated/headasbooleantrue/generated_tests/test_visibility_async.py @@ -12,7 +12,8 @@ class TestVisibilityAsync(VisibilityClientTestBaseAsync): async def test_get_model(self, visibility_endpoint): client = self.create_async_client(endpoint=visibility_endpoint) response = await client.get_model( - input={"createProp": ["str"], "deleteProp": bool, "queryProp": 0, "readProp": "str", "updateProp": [0]}, + input={"createProp": ["str"], "deleteProp": bool, "readProp": "str", "updateProp": [0]}, + query_prop=0, ) # please add some check logic here by yourself @@ -23,7 +24,8 @@ async def test_get_model(self, visibility_endpoint): async def test_head_model(self, visibility_endpoint): client = self.create_async_client(endpoint=visibility_endpoint) response = await client.head_model( - input={"createProp": ["str"], "deleteProp": bool, "queryProp": 0, "readProp": "str", "updateProp": [0]}, + input={"createProp": ["str"], "deleteProp": bool, "readProp": "str", "updateProp": [0]}, + query_prop=0, ) # please add some check logic here by yourself @@ -34,7 +36,7 @@ async def test_head_model(self, visibility_endpoint): async def test_put_model(self, visibility_endpoint): client = self.create_async_client(endpoint=visibility_endpoint) response = await client.put_model( - input={"createProp": ["str"], "deleteProp": bool, "queryProp": 0, "readProp": "str", "updateProp": [0]}, + input={"createProp": ["str"], "deleteProp": bool, "readProp": "str", "updateProp": [0]}, ) # please add some check logic here by yourself @@ -45,7 +47,7 @@ async def test_put_model(self, visibility_endpoint): async def test_patch_model(self, visibility_endpoint): client = self.create_async_client(endpoint=visibility_endpoint) response = await client.patch_model( - input={"createProp": ["str"], "deleteProp": bool, "queryProp": 0, "readProp": "str", "updateProp": [0]}, + input={"createProp": ["str"], "deleteProp": bool, "readProp": "str", "updateProp": [0]}, ) # please add some check logic here by yourself @@ -56,7 +58,7 @@ async def test_patch_model(self, visibility_endpoint): async def test_post_model(self, visibility_endpoint): client = self.create_async_client(endpoint=visibility_endpoint) response = await client.post_model( - input={"createProp": ["str"], "deleteProp": bool, "queryProp": 0, "readProp": "str", "updateProp": [0]}, + input={"createProp": ["str"], "deleteProp": bool, "readProp": "str", "updateProp": [0]}, ) # please add some check logic here by yourself @@ -67,7 +69,7 @@ async def test_post_model(self, visibility_endpoint): async def test_delete_model(self, visibility_endpoint): client = self.create_async_client(endpoint=visibility_endpoint) response = await client.delete_model( - input={"createProp": ["str"], "deleteProp": bool, "queryProp": 0, "readProp": "str", "updateProp": [0]}, + input={"createProp": ["str"], "deleteProp": bool, "readProp": "str", "updateProp": [0]}, ) # please add some check logic here by yourself diff --git a/packages/typespec-python/test/azure/generated/headasbooleantrue/headasbooleantrue/_operations/_operations.py b/packages/typespec-python/test/azure/generated/headasbooleantrue/headasbooleantrue/_operations/_operations.py index 5c004616394..d40d50d3754 100644 --- a/packages/typespec-python/test/azure/generated/headasbooleantrue/headasbooleantrue/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/headasbooleantrue/headasbooleantrue/_operations/_operations.py @@ -36,8 +36,9 @@ _SERIALIZER.client_side_validation = False -def build_visibility_get_model_request(**kwargs: Any) -> HttpRequest: +def build_visibility_get_model_request(*, query_prop: int, **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)) accept = _headers.pop("Accept", "application/json") @@ -45,26 +46,33 @@ def build_visibility_get_model_request(**kwargs: Any) -> HttpRequest: # Construct URL _url = "/type/model/visibility" + # Construct parameters + _params["queryProp"] = _SERIALIZER.query("query_prop", query_prop, "int") + # 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="GET", url=_url, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_visibility_head_model_request(**kwargs: Any) -> HttpRequest: +def build_visibility_head_model_request(*, query_prop: int, **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)) # Construct URL _url = "/type/model/visibility" + # Construct parameters + _params["queryProp"] = _SERIALIZER.query("query_prop", query_prop, "int") + # Construct headers if content_type is not None: _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - return HttpRequest(method="HEAD", url=_url, headers=_headers, **kwargs) + return HttpRequest(method="HEAD", url=_url, params=_params, headers=_headers, **kwargs) def build_visibility_put_model_request(**kwargs: Any) -> HttpRequest: @@ -144,12 +152,14 @@ class VisibilityClientOperationsMixin(VisibilityClientMixinABC): @overload def get_model( - self, input: _models.VisibilityModel, *, content_type: str = "application/json", **kwargs: Any + self, input: _models.VisibilityModel, *, query_prop: int, content_type: str = "application/json", **kwargs: Any ) -> _models.VisibilityModel: """get_model. :param input: Required. :type input: ~headasbooleantrue.models.VisibilityModel + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -160,12 +170,14 @@ def get_model( @overload def get_model( - self, input: JSON, *, content_type: str = "application/json", **kwargs: Any + self, input: JSON, *, query_prop: int, content_type: str = "application/json", **kwargs: Any ) -> _models.VisibilityModel: """get_model. :param input: Required. :type input: JSON + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -176,12 +188,14 @@ def get_model( @overload def get_model( - self, input: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + self, input: IO[bytes], *, query_prop: int, content_type: str = "application/json", **kwargs: Any ) -> _models.VisibilityModel: """get_model. :param input: Required. :type input: IO[bytes] + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -192,12 +206,14 @@ def get_model( @distributed_trace def get_model( - self, input: Union[_models.VisibilityModel, JSON, IO[bytes]], **kwargs: Any + self, input: Union[_models.VisibilityModel, JSON, IO[bytes]], *, query_prop: int, **kwargs: Any ) -> _models.VisibilityModel: """get_model. :param input: Is one of the following types: VisibilityModel, JSON, IO[bytes] Required. :type input: ~headasbooleantrue.models.VisibilityModel or JSON or IO[bytes] + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :return: VisibilityModel. The VisibilityModel is compatible with MutableMapping :rtype: ~headasbooleantrue.models.VisibilityModel :raises ~azure.core.exceptions.HttpResponseError: @@ -224,6 +240,7 @@ def get_model( _content = json.dumps(input, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_visibility_get_model_request( + query_prop=query_prop, content_type=content_type, content=_content, headers=_headers, @@ -262,12 +279,14 @@ def get_model( @overload def head_model( - self, input: _models.VisibilityModel, *, content_type: str = "application/json", **kwargs: Any + self, input: _models.VisibilityModel, *, query_prop: int, content_type: str = "application/json", **kwargs: Any ) -> bool: """head_model. :param input: Required. :type input: ~headasbooleantrue.models.VisibilityModel + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -277,11 +296,15 @@ def head_model( """ @overload - def head_model(self, input: JSON, *, content_type: str = "application/json", **kwargs: Any) -> bool: + def head_model( + self, input: JSON, *, query_prop: int, content_type: str = "application/json", **kwargs: Any + ) -> bool: """head_model. :param input: Required. :type input: JSON + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -291,11 +314,15 @@ def head_model(self, input: JSON, *, content_type: str = "application/json", **k """ @overload - def head_model(self, input: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> bool: + def head_model( + self, input: IO[bytes], *, query_prop: int, content_type: str = "application/json", **kwargs: Any + ) -> bool: """head_model. :param input: Required. :type input: IO[bytes] + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -305,11 +332,15 @@ def head_model(self, input: IO[bytes], *, content_type: str = "application/json" """ @distributed_trace - def head_model(self, input: Union[_models.VisibilityModel, JSON, IO[bytes]], **kwargs: Any) -> bool: + def head_model( + self, input: Union[_models.VisibilityModel, JSON, IO[bytes]], *, query_prop: int, **kwargs: Any + ) -> bool: """head_model. :param input: Is one of the following types: VisibilityModel, JSON, IO[bytes] Required. :type input: ~headasbooleantrue.models.VisibilityModel or JSON or IO[bytes] + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :return: bool :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: @@ -336,6 +367,7 @@ def head_model(self, input: Union[_models.VisibilityModel, JSON, IO[bytes]], **k _content = json.dumps(input, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_visibility_head_model_request( + query_prop=query_prop, content_type=content_type, content=_content, headers=_headers, diff --git a/packages/typespec-python/test/azure/generated/headasbooleantrue/headasbooleantrue/aio/_operations/_operations.py b/packages/typespec-python/test/azure/generated/headasbooleantrue/headasbooleantrue/aio/_operations/_operations.py index c57628b254b..a99f2f26a28 100644 --- a/packages/typespec-python/test/azure/generated/headasbooleantrue/headasbooleantrue/aio/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/headasbooleantrue/headasbooleantrue/aio/_operations/_operations.py @@ -46,12 +46,14 @@ class VisibilityClientOperationsMixin(VisibilityClientMixinABC): @overload async def get_model( - self, input: _models.VisibilityModel, *, content_type: str = "application/json", **kwargs: Any + self, input: _models.VisibilityModel, *, query_prop: int, content_type: str = "application/json", **kwargs: Any ) -> _models.VisibilityModel: """get_model. :param input: Required. :type input: ~headasbooleantrue.models.VisibilityModel + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -62,12 +64,14 @@ async def get_model( @overload async def get_model( - self, input: JSON, *, content_type: str = "application/json", **kwargs: Any + self, input: JSON, *, query_prop: int, content_type: str = "application/json", **kwargs: Any ) -> _models.VisibilityModel: """get_model. :param input: Required. :type input: JSON + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -78,12 +82,14 @@ async def get_model( @overload async def get_model( - self, input: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + self, input: IO[bytes], *, query_prop: int, content_type: str = "application/json", **kwargs: Any ) -> _models.VisibilityModel: """get_model. :param input: Required. :type input: IO[bytes] + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -94,12 +100,14 @@ async def get_model( @distributed_trace_async async def get_model( - self, input: Union[_models.VisibilityModel, JSON, IO[bytes]], **kwargs: Any + self, input: Union[_models.VisibilityModel, JSON, IO[bytes]], *, query_prop: int, **kwargs: Any ) -> _models.VisibilityModel: """get_model. :param input: Is one of the following types: VisibilityModel, JSON, IO[bytes] Required. :type input: ~headasbooleantrue.models.VisibilityModel or JSON or IO[bytes] + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :return: VisibilityModel. The VisibilityModel is compatible with MutableMapping :rtype: ~headasbooleantrue.models.VisibilityModel :raises ~azure.core.exceptions.HttpResponseError: @@ -126,6 +134,7 @@ async def get_model( _content = json.dumps(input, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_visibility_get_model_request( + query_prop=query_prop, content_type=content_type, content=_content, headers=_headers, @@ -164,12 +173,14 @@ async def get_model( @overload async def head_model( - self, input: _models.VisibilityModel, *, content_type: str = "application/json", **kwargs: Any + self, input: _models.VisibilityModel, *, query_prop: int, content_type: str = "application/json", **kwargs: Any ) -> bool: """head_model. :param input: Required. :type input: ~headasbooleantrue.models.VisibilityModel + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -179,11 +190,15 @@ async def head_model( """ @overload - async def head_model(self, input: JSON, *, content_type: str = "application/json", **kwargs: Any) -> bool: + async def head_model( + self, input: JSON, *, query_prop: int, content_type: str = "application/json", **kwargs: Any + ) -> bool: """head_model. :param input: Required. :type input: JSON + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -193,11 +208,15 @@ async def head_model(self, input: JSON, *, content_type: str = "application/json """ @overload - async def head_model(self, input: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> bool: + async def head_model( + self, input: IO[bytes], *, query_prop: int, content_type: str = "application/json", **kwargs: Any + ) -> bool: """head_model. :param input: Required. :type input: IO[bytes] + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -207,11 +226,15 @@ async def head_model(self, input: IO[bytes], *, content_type: str = "application """ @distributed_trace_async - async def head_model(self, input: Union[_models.VisibilityModel, JSON, IO[bytes]], **kwargs: Any) -> bool: + async def head_model( + self, input: Union[_models.VisibilityModel, JSON, IO[bytes]], *, query_prop: int, **kwargs: Any + ) -> bool: """head_model. :param input: Is one of the following types: VisibilityModel, JSON, IO[bytes] Required. :type input: ~headasbooleantrue.models.VisibilityModel or JSON or IO[bytes] + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :return: bool :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: @@ -238,6 +261,7 @@ async def head_model(self, input: Union[_models.VisibilityModel, JSON, IO[bytes] _content = json.dumps(input, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_visibility_head_model_request( + query_prop=query_prop, content_type=content_type, content=_content, headers=_headers, diff --git a/packages/typespec-python/test/azure/generated/headasbooleantrue/headasbooleantrue/models/_models.py b/packages/typespec-python/test/azure/generated/headasbooleantrue/headasbooleantrue/models/_models.py index e9e648696dc..a302369b8a6 100644 --- a/packages/typespec-python/test/azure/generated/headasbooleantrue/headasbooleantrue/models/_models.py +++ b/packages/typespec-python/test/azure/generated/headasbooleantrue/headasbooleantrue/models/_models.py @@ -27,8 +27,6 @@ class VisibilityModel(_model_base.Model): :ivar read_prop: Required string, illustrating a readonly property. Required. :vartype read_prop: str - :ivar query_prop: Required int32, illustrating a query property. Required. - :vartype query_prop: int :ivar create_prop: Required string[], illustrating a create property. Required. :vartype create_prop: list[str] :ivar update_prop: Required int32[], illustrating a update property. Required. @@ -39,8 +37,6 @@ class VisibilityModel(_model_base.Model): read_prop: str = rest_field(name="readProp", visibility=["read"]) """Required string, illustrating a readonly property. Required.""" - query_prop: int = rest_field(name="queryProp", visibility=["query"]) - """Required int32, illustrating a query property. Required.""" create_prop: List[str] = rest_field(name="createProp", visibility=["create"]) """Required string[], illustrating a create property. Required.""" update_prop: List[int] = rest_field(name="updateProp", visibility=["update"]) @@ -52,7 +48,6 @@ class VisibilityModel(_model_base.Model): def __init__( self, *, - query_prop: int, create_prop: List[str], update_prop: List[int], delete_prop: bool, diff --git a/packages/typespec-python/test/azure/generated/payload-multipart/apiview-properties.json b/packages/typespec-python/test/azure/generated/payload-multipart/apiview-properties.json index 01e6180bb23..8d2f6caac44 100644 --- a/packages/typespec-python/test/azure/generated/payload-multipart/apiview-properties.json +++ b/packages/typespec-python/test/azure/generated/payload-multipart/apiview-properties.json @@ -2,6 +2,7 @@ "CrossLanguagePackageId": "Payload.MultiPart", "CrossLanguageDefinitionId": { "payload.multipart.models.Address": "Payload.MultiPart.Address", + "payload.multipart.models.AnonymousModelRequest": "Payload.MultiPart.FormData.anonymousModel.Request.anonymous", "payload.multipart.models.BinaryArrayPartsRequest": "Payload.MultiPart.BinaryArrayPartsRequest", "payload.multipart.models.ComplexHttpPartsModelRequest": "Payload.MultiPart.ComplexHttpPartsModelRequest", "payload.multipart.models.ComplexPartsRequest": "Payload.MultiPart.ComplexPartsRequest", 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 f5a69add300..e6ecbc201fa 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 @@ -78,7 +78,6 @@ 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"}, - profile_image="filetype", ) # 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 53828e8adfc..1cdb43e278b 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 @@ -79,7 +79,6 @@ 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"}, - profile_image="filetype", ) # 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 6194d90cea8..abb46fdee42 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 @@ -18,7 +18,7 @@ from ... import _model_base, models as _models from ..._serialization import Deserializer, Serializer -from ..._vendor import FileType, prepare_multipart_form_data +from ..._vendor import prepare_multipart_form_data from ...operations._operations import ( build_form_data_anonymous_model_request, build_form_data_basic_request, @@ -40,7 +40,6 @@ else: from typing import MutableMapping # type: ignore JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object -_Unset: Any = object() T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -517,11 +516,11 @@ async def check_file_name_and_content_type( return cls(pipeline_response, None, {}) # type: ignore @overload - async def anonymous_model(self, *, profile_image: FileType, **kwargs: Any) -> None: + async def anonymous_model(self, body: _models.AnonymousModelRequest, **kwargs: Any) -> None: """Test content-type: multipart/form-data. - :keyword profile_image: Required. - :paramtype profile_image: ~payload.multipart._vendor.FileType + :param body: Required. + :type body: ~payload.multipart.models.AnonymousModelRequest :return: None :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -539,13 +538,11 @@ async def anonymous_model(self, body: JSON, **kwargs: Any) -> None: """ @distributed_trace_async - async def anonymous_model(self, body: JSON = _Unset, *, profile_image: FileType = _Unset, **kwargs: Any) -> None: + async def anonymous_model(self, body: Union[_models.AnonymousModelRequest, JSON], **kwargs: Any) -> None: """Test content-type: multipart/form-data. - :param body: Is one of the following types: JSON Required. - :type body: JSON - :keyword profile_image: Required. - :paramtype profile_image: ~payload.multipart._vendor.FileType + :param body: Is either a AnonymousModelRequest type or a JSON type. Required. + :type body: ~payload.multipart.models.AnonymousModelRequest or JSON :return: None :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -563,11 +560,6 @@ async def anonymous_model(self, body: JSON = _Unset, *, profile_image: FileType cls: ClsType[None] = kwargs.pop("cls", None) - if body is _Unset: - if profile_image is _Unset: - raise TypeError("missing required argument: profile_image") - body = {"profileImage": profile_image} - body = {k: v for k, v in body.items() if v is not None} _body = body.as_dict() if isinstance(body, _model_base.Model) else body _file_fields: List[str] = ["profileImage"] _data_fields: List[str] = [] 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 30b197f53e3..a308cc58100 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 @@ -9,6 +9,7 @@ from ._models import ( # type: ignore Address, + AnonymousModelRequest, BinaryArrayPartsRequest, ComplexHttpPartsModelRequest, ComplexPartsRequest, @@ -26,6 +27,7 @@ __all__ = [ "Address", + "AnonymousModelRequest", "BinaryArrayPartsRequest", "ComplexHttpPartsModelRequest", "ComplexPartsRequest", 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 a081a9f59d9..17e17689542 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 @@ -39,6 +39,36 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) +class AnonymousModelRequest(_model_base.Model): + """AnonymousModelRequest. + + :ivar profile_image: Required. + :vartype profile_image: ~payload.multipart._vendor.FileType + """ + + profile_image: FileType = rest_field( + name="profileImage", visibility=["read", "create", "update", "delete", "query"], is_multipart_file_input=True + ) + """Required.""" + + @overload + def __init__( + self, + *, + profile_image: FileType, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + class BinaryArrayPartsRequest(_model_base.Model): """BinaryArrayPartsRequest. 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 c4ac32d88ad..8cff6033143 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 @@ -20,14 +20,13 @@ from .. import _model_base, models as _models from .._configuration import MultiPartClientConfiguration from .._serialization import Deserializer, Serializer -from .._vendor import FileType, prepare_multipart_form_data +from .._vendor import prepare_multipart_form_data if sys.version_info >= (3, 9): from collections.abc import MutableMapping else: from typing import MutableMapping # type: ignore JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object -_Unset: Any = object() T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -635,11 +634,11 @@ def check_file_name_and_content_type( # pylint: disable=inconsistent-return-sta return cls(pipeline_response, None, {}) # type: ignore @overload - def anonymous_model(self, *, profile_image: FileType, **kwargs: Any) -> None: + def anonymous_model(self, body: _models.AnonymousModelRequest, **kwargs: Any) -> None: """Test content-type: multipart/form-data. - :keyword profile_image: Required. - :paramtype profile_image: ~payload.multipart._vendor.FileType + :param body: Required. + :type body: ~payload.multipart.models.AnonymousModelRequest :return: None :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -658,14 +657,12 @@ def anonymous_model(self, body: JSON, **kwargs: Any) -> None: @distributed_trace def anonymous_model( # pylint: disable=inconsistent-return-statements - self, body: JSON = _Unset, *, profile_image: FileType = _Unset, **kwargs: Any + self, body: Union[_models.AnonymousModelRequest, JSON], **kwargs: Any ) -> None: """Test content-type: multipart/form-data. - :param body: Is one of the following types: JSON Required. - :type body: JSON - :keyword profile_image: Required. - :paramtype profile_image: ~payload.multipart._vendor.FileType + :param body: Is either a AnonymousModelRequest type or a JSON type. Required. + :type body: ~payload.multipart.models.AnonymousModelRequest or JSON :return: None :rtype: None :raises ~azure.core.exceptions.HttpResponseError: @@ -683,11 +680,6 @@ def anonymous_model( # pylint: disable=inconsistent-return-statements cls: ClsType[None] = kwargs.pop("cls", None) - if body is _Unset: - if profile_image is _Unset: - raise TypeError("missing required argument: profile_image") - body = {"profileImage": profile_image} - body = {k: v for k, v in body.items() if v is not None} _body = body.as_dict() if isinstance(body, _model_base.Model) else body _file_fields: List[str] = ["profileImage"] _data_fields: List[str] = [] diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_client.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_client.py index ed7a6a9748b..9dfb8f50961 100644 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_client.py +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_client.py @@ -82,7 +82,7 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "serviceDeploymentVersion": self._serialize.url( "self._config.service_deployment_version", self._config.service_deployment_version, diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_operations/_operations.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_operations/_operations.py index ab7cd86cfd6..afbbd99f809 100644 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_operations/_operations.py @@ -96,7 +96,7 @@ def from_none(self, **kwargs: Any) -> bool: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "serviceDeploymentVersion": self._serialize.url( "self._config.service_deployment_version", self._config.service_deployment_version, @@ -156,7 +156,7 @@ def from_one_required( # pylint: disable=inconsistent-return-statements params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "serviceDeploymentVersion": self._serialize.url( "self._config.service_deployment_version", self._config.service_deployment_version, @@ -215,7 +215,7 @@ def from_one_optional( # pylint: disable=inconsistent-return-statements params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "serviceDeploymentVersion": self._serialize.url( "self._config.service_deployment_version", self._config.service_deployment_version, diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/aio/_client.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/aio/_client.py index 70dfe28156e..919a83a2aed 100644 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/aio/_client.py +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/aio/_client.py @@ -84,7 +84,7 @@ def send_request( request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "serviceDeploymentVersion": self._serialize.url( "self._config.service_deployment_version", self._config.service_deployment_version, diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/aio/_operations/_operations.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/aio/_operations/_operations.py index 549efcfdce9..8eabf7cf3d7 100644 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/aio/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/aio/_operations/_operations.py @@ -61,7 +61,7 @@ async def from_none(self, **kwargs: Any) -> bool: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "serviceDeploymentVersion": self._serialize.url( "self._config.service_deployment_version", self._config.service_deployment_version, @@ -119,7 +119,7 @@ async def from_one_required(self, *, parameter: str, **kwargs: Any) -> None: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "serviceDeploymentVersion": self._serialize.url( "self._config.service_deployment_version", self._config.service_deployment_version, @@ -176,7 +176,7 @@ async def from_one_optional(self, *, parameter: Optional[str] = None, **kwargs: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "serviceDeploymentVersion": self._serialize.url( "self._config.service_deployment_version", self._config.service_deployment_version, diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_client.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_client.py index 7eea4a5a594..c1a31fdd1e2 100644 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_client.py +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_client.py @@ -99,7 +99,7 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "serviceDeploymentVersion": self._serialize.url( "self._config.service_deployment_version", self._config.service_deployment_version, diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_operations/_operations.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_operations/_operations.py index 8a845ee461b..806622bbb93 100644 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_operations/_operations.py @@ -120,7 +120,7 @@ def add_operation(self, **kwargs: Any) -> None: # pylint: disable=inconsistent- params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "serviceDeploymentVersion": self._serialize.url( "self._config.service_deployment_version", self._config.service_deployment_version, @@ -179,7 +179,7 @@ def from_none(self, *, new_parameter: Optional[str] = None, **kwargs: Any) -> bo params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "serviceDeploymentVersion": self._serialize.url( "self._config.service_deployment_version", self._config.service_deployment_version, @@ -245,7 +245,7 @@ def from_one_required( # pylint: disable=inconsistent-return-statements params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "serviceDeploymentVersion": self._serialize.url( "self._config.service_deployment_version", self._config.service_deployment_version, @@ -310,7 +310,7 @@ def from_one_optional( # pylint: disable=inconsistent-return-statements params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "serviceDeploymentVersion": self._serialize.url( "self._config.service_deployment_version", self._config.service_deployment_version, diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/aio/_client.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/aio/_client.py index ecb3c581a1a..c12f0bbdfa5 100644 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/aio/_client.py +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/aio/_client.py @@ -101,7 +101,7 @@ def send_request( request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "serviceDeploymentVersion": self._serialize.url( "self._config.service_deployment_version", self._config.service_deployment_version, diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/aio/_operations/_operations.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/aio/_operations/_operations.py index ba005f9dfa9..6c49b95bc1a 100644 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/aio/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/aio/_operations/_operations.py @@ -65,7 +65,7 @@ async def add_operation(self, **kwargs: Any) -> None: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "serviceDeploymentVersion": self._serialize.url( "self._config.service_deployment_version", self._config.service_deployment_version, @@ -124,7 +124,7 @@ async def from_none(self, *, new_parameter: Optional[str] = None, **kwargs: Any) params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "serviceDeploymentVersion": self._serialize.url( "self._config.service_deployment_version", self._config.service_deployment_version, @@ -188,7 +188,7 @@ async def from_one_required(self, *, parameter: str, new_parameter: Optional[str params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "serviceDeploymentVersion": self._serialize.url( "self._config.service_deployment_version", self._config.service_deployment_version, @@ -253,7 +253,7 @@ async def from_one_optional( params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "serviceDeploymentVersion": self._serialize.url( "self._config.service_deployment_version", self._config.service_deployment_version, diff --git a/packages/typespec-python/test/azure/generated/server-path-multiple/server/path/multiple/_client.py b/packages/typespec-python/test/azure/generated/server-path-multiple/server/path/multiple/_client.py index c4bb0afc22d..c8cd0204d31 100644 --- a/packages/typespec-python/test/azure/generated/server-path-multiple/server/path/multiple/_client.py +++ b/packages/typespec-python/test/azure/generated/server-path-multiple/server/path/multiple/_client.py @@ -72,7 +72,7 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "apiVersion": self._serialize.url( "self._config.api_version", self._config.api_version, "str", skip_quote=True ), diff --git a/packages/typespec-python/test/azure/generated/server-path-multiple/server/path/multiple/_operations/_operations.py b/packages/typespec-python/test/azure/generated/server-path-multiple/server/path/multiple/_operations/_operations.py index ea94aff0e04..ed50296fd85 100644 --- a/packages/typespec-python/test/azure/generated/server-path-multiple/server/path/multiple/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/server-path-multiple/server/path/multiple/_operations/_operations.py @@ -77,7 +77,7 @@ def no_operation_params(self, **kwargs: Any) -> None: # pylint: disable=inconsi params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "apiVersion": self._serialize.url( "self._config.api_version", self._config.api_version, "str", skip_quote=True ), @@ -129,7 +129,7 @@ def with_operation_path_param( # pylint: disable=inconsistent-return-statements params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "apiVersion": self._serialize.url( "self._config.api_version", self._config.api_version, "str", skip_quote=True ), diff --git a/packages/typespec-python/test/azure/generated/server-path-multiple/server/path/multiple/aio/_client.py b/packages/typespec-python/test/azure/generated/server-path-multiple/server/path/multiple/aio/_client.py index 2dea1cfb1e8..05d592e45cc 100644 --- a/packages/typespec-python/test/azure/generated/server-path-multiple/server/path/multiple/aio/_client.py +++ b/packages/typespec-python/test/azure/generated/server-path-multiple/server/path/multiple/aio/_client.py @@ -74,7 +74,7 @@ def send_request( request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "apiVersion": self._serialize.url( "self._config.api_version", self._config.api_version, "str", skip_quote=True ), diff --git a/packages/typespec-python/test/azure/generated/server-path-multiple/server/path/multiple/aio/_operations/_operations.py b/packages/typespec-python/test/azure/generated/server-path-multiple/server/path/multiple/aio/_operations/_operations.py index 1a6ba01c3be..b5f838eeae1 100644 --- a/packages/typespec-python/test/azure/generated/server-path-multiple/server/path/multiple/aio/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/server-path-multiple/server/path/multiple/aio/_operations/_operations.py @@ -57,7 +57,7 @@ async def no_operation_params(self, **kwargs: Any) -> None: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "apiVersion": self._serialize.url( "self._config.api_version", self._config.api_version, "str", skip_quote=True ), @@ -107,7 +107,7 @@ async def with_operation_path_param(self, keyword: str, **kwargs: Any) -> None: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "apiVersion": self._serialize.url( "self._config.api_version", self._config.api_version, "str", skip_quote=True ), diff --git a/packages/typespec-python/test/azure/generated/server-path-single/server/path/single/_client.py b/packages/typespec-python/test/azure/generated/server-path-single/server/path/single/_client.py index 6892c9a662a..365941ca72d 100644 --- a/packages/typespec-python/test/azure/generated/server-path-single/server/path/single/_client.py +++ b/packages/typespec-python/test/azure/generated/server-path-single/server/path/single/_client.py @@ -69,7 +69,7 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), } request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) diff --git a/packages/typespec-python/test/azure/generated/server-path-single/server/path/single/_operations/_operations.py b/packages/typespec-python/test/azure/generated/server-path-single/server/path/single/_operations/_operations.py index 8745de9c5ae..48ece05c1b3 100644 --- a/packages/typespec-python/test/azure/generated/server-path-single/server/path/single/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/server-path-single/server/path/single/_operations/_operations.py @@ -63,7 +63,7 @@ def my_op(self, **kwargs: Any) -> bool: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) diff --git a/packages/typespec-python/test/azure/generated/server-path-single/server/path/single/aio/_client.py b/packages/typespec-python/test/azure/generated/server-path-single/server/path/single/aio/_client.py index 3fcfcf0f7c7..f579824eda2 100644 --- a/packages/typespec-python/test/azure/generated/server-path-single/server/path/single/aio/_client.py +++ b/packages/typespec-python/test/azure/generated/server-path-single/server/path/single/aio/_client.py @@ -71,7 +71,7 @@ def send_request( request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), } request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) diff --git a/packages/typespec-python/test/azure/generated/server-path-single/server/path/single/aio/_operations/_operations.py b/packages/typespec-python/test/azure/generated/server-path-single/server/path/single/aio/_operations/_operations.py index a4fcb3cb3be..58e0ac472f9 100644 --- a/packages/typespec-python/test/azure/generated/server-path-single/server/path/single/aio/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/server-path-single/server/path/single/aio/_operations/_operations.py @@ -54,7 +54,7 @@ async def my_op(self, **kwargs: Any) -> bool: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) diff --git a/packages/typespec-python/test/azure/generated/server-versions-not-versioned/server/versions/notversioned/_client.py b/packages/typespec-python/test/azure/generated/server-versions-not-versioned/server/versions/notversioned/_client.py index b281edd7417..36704878d9a 100644 --- a/packages/typespec-python/test/azure/generated/server-versions-not-versioned/server/versions/notversioned/_client.py +++ b/packages/typespec-python/test/azure/generated/server-versions-not-versioned/server/versions/notversioned/_client.py @@ -69,7 +69,7 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), } request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) diff --git a/packages/typespec-python/test/azure/generated/server-versions-not-versioned/server/versions/notversioned/_operations/_operations.py b/packages/typespec-python/test/azure/generated/server-versions-not-versioned/server/versions/notversioned/_operations/_operations.py index dcd2cec01a7..bcc61140f1e 100644 --- a/packages/typespec-python/test/azure/generated/server-versions-not-versioned/server/versions/notversioned/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/server-versions-not-versioned/server/versions/notversioned/_operations/_operations.py @@ -92,7 +92,7 @@ def without_api_version(self, **kwargs: Any) -> bool: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -140,7 +140,7 @@ def with_query_api_version(self, *, api_version: str, **kwargs: Any) -> bool: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -188,7 +188,7 @@ def with_path_api_version(self, api_version: str, **kwargs: Any) -> bool: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) diff --git a/packages/typespec-python/test/azure/generated/server-versions-not-versioned/server/versions/notversioned/aio/_client.py b/packages/typespec-python/test/azure/generated/server-versions-not-versioned/server/versions/notversioned/aio/_client.py index 9854de87979..1d58ee2933d 100644 --- a/packages/typespec-python/test/azure/generated/server-versions-not-versioned/server/versions/notversioned/aio/_client.py +++ b/packages/typespec-python/test/azure/generated/server-versions-not-versioned/server/versions/notversioned/aio/_client.py @@ -71,7 +71,7 @@ def send_request( request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), } request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) diff --git a/packages/typespec-python/test/azure/generated/server-versions-not-versioned/server/versions/notversioned/aio/_operations/_operations.py b/packages/typespec-python/test/azure/generated/server-versions-not-versioned/server/versions/notversioned/aio/_operations/_operations.py index a819009c4e5..f1cd973a764 100644 --- a/packages/typespec-python/test/azure/generated/server-versions-not-versioned/server/versions/notversioned/aio/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/server-versions-not-versioned/server/versions/notversioned/aio/_operations/_operations.py @@ -58,7 +58,7 @@ async def without_api_version(self, **kwargs: Any) -> bool: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -106,7 +106,7 @@ async def with_query_api_version(self, *, api_version: str, **kwargs: Any) -> bo params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -154,7 +154,7 @@ async def with_path_api_version(self, api_version: str, **kwargs: Any) -> bool: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) diff --git a/packages/typespec-python/test/azure/generated/server-versions-versioned/server/versions/versioned/_client.py b/packages/typespec-python/test/azure/generated/server-versions-versioned/server/versions/versioned/_client.py index 391f606b150..4665695131e 100644 --- a/packages/typespec-python/test/azure/generated/server-versions-versioned/server/versions/versioned/_client.py +++ b/packages/typespec-python/test/azure/generated/server-versions-versioned/server/versions/versioned/_client.py @@ -72,7 +72,7 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), } request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) diff --git a/packages/typespec-python/test/azure/generated/server-versions-versioned/server/versions/versioned/_operations/_operations.py b/packages/typespec-python/test/azure/generated/server-versions-versioned/server/versions/versioned/_operations/_operations.py index 8e249e2cad7..6d5055139c6 100644 --- a/packages/typespec-python/test/azure/generated/server-versions-versioned/server/versions/versioned/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/server-versions-versioned/server/versions/versioned/_operations/_operations.py @@ -103,7 +103,7 @@ def without_api_version(self, **kwargs: Any) -> bool: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -149,7 +149,7 @@ def with_query_api_version(self, **kwargs: Any) -> bool: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -195,7 +195,7 @@ def with_path_api_version(self, **kwargs: Any) -> bool: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -241,7 +241,7 @@ def with_query_old_api_version(self, **kwargs: Any) -> bool: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) diff --git a/packages/typespec-python/test/azure/generated/server-versions-versioned/server/versions/versioned/aio/_client.py b/packages/typespec-python/test/azure/generated/server-versions-versioned/server/versions/versioned/aio/_client.py index 9d2b09d077a..f2a900df25a 100644 --- a/packages/typespec-python/test/azure/generated/server-versions-versioned/server/versions/versioned/aio/_client.py +++ b/packages/typespec-python/test/azure/generated/server-versions-versioned/server/versions/versioned/aio/_client.py @@ -74,7 +74,7 @@ def send_request( request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), } request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) diff --git a/packages/typespec-python/test/azure/generated/server-versions-versioned/server/versions/versioned/aio/_operations/_operations.py b/packages/typespec-python/test/azure/generated/server-versions-versioned/server/versions/versioned/aio/_operations/_operations.py index 9c169cc2b33..70bc034b288 100644 --- a/packages/typespec-python/test/azure/generated/server-versions-versioned/server/versions/versioned/aio/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/server-versions-versioned/server/versions/versioned/aio/_operations/_operations.py @@ -59,7 +59,7 @@ async def without_api_version(self, **kwargs: Any) -> bool: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -105,7 +105,7 @@ async def with_query_api_version(self, **kwargs: Any) -> bool: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -151,7 +151,7 @@ async def with_path_api_version(self, **kwargs: Any) -> bool: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -197,7 +197,7 @@ async def with_query_old_api_version(self, **kwargs: Any) -> bool: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) diff --git a/packages/typespec-python/test/azure/generated/typetest-model-visibility/generated_tests/test_visibility.py b/packages/typespec-python/test/azure/generated/typetest-model-visibility/generated_tests/test_visibility.py index 337f1f994a7..889908e6993 100644 --- a/packages/typespec-python/test/azure/generated/typetest-model-visibility/generated_tests/test_visibility.py +++ b/packages/typespec-python/test/azure/generated/typetest-model-visibility/generated_tests/test_visibility.py @@ -11,7 +11,8 @@ class TestVisibility(VisibilityClientTestBase): def test_get_model(self, visibility_endpoint): client = self.create_client(endpoint=visibility_endpoint) response = client.get_model( - input={"createProp": ["str"], "deleteProp": bool, "queryProp": 0, "readProp": "str", "updateProp": [0]}, + input={"createProp": ["str"], "deleteProp": bool, "readProp": "str", "updateProp": [0]}, + query_prop=0, ) # please add some check logic here by yourself @@ -22,7 +23,8 @@ def test_get_model(self, visibility_endpoint): def test_head_model(self, visibility_endpoint): client = self.create_client(endpoint=visibility_endpoint) response = client.head_model( - input={"createProp": ["str"], "deleteProp": bool, "queryProp": 0, "readProp": "str", "updateProp": [0]}, + input={"createProp": ["str"], "deleteProp": bool, "readProp": "str", "updateProp": [0]}, + query_prop=0, ) # please add some check logic here by yourself @@ -33,7 +35,7 @@ def test_head_model(self, visibility_endpoint): def test_put_model(self, visibility_endpoint): client = self.create_client(endpoint=visibility_endpoint) response = client.put_model( - input={"createProp": ["str"], "deleteProp": bool, "queryProp": 0, "readProp": "str", "updateProp": [0]}, + input={"createProp": ["str"], "deleteProp": bool, "readProp": "str", "updateProp": [0]}, ) # please add some check logic here by yourself @@ -44,7 +46,7 @@ def test_put_model(self, visibility_endpoint): def test_patch_model(self, visibility_endpoint): client = self.create_client(endpoint=visibility_endpoint) response = client.patch_model( - input={"createProp": ["str"], "deleteProp": bool, "queryProp": 0, "readProp": "str", "updateProp": [0]}, + input={"createProp": ["str"], "deleteProp": bool, "readProp": "str", "updateProp": [0]}, ) # please add some check logic here by yourself @@ -55,7 +57,7 @@ def test_patch_model(self, visibility_endpoint): def test_post_model(self, visibility_endpoint): client = self.create_client(endpoint=visibility_endpoint) response = client.post_model( - input={"createProp": ["str"], "deleteProp": bool, "queryProp": 0, "readProp": "str", "updateProp": [0]}, + input={"createProp": ["str"], "deleteProp": bool, "readProp": "str", "updateProp": [0]}, ) # please add some check logic here by yourself @@ -66,7 +68,7 @@ def test_post_model(self, visibility_endpoint): def test_delete_model(self, visibility_endpoint): client = self.create_client(endpoint=visibility_endpoint) response = client.delete_model( - input={"createProp": ["str"], "deleteProp": bool, "queryProp": 0, "readProp": "str", "updateProp": [0]}, + input={"createProp": ["str"], "deleteProp": bool, "readProp": "str", "updateProp": [0]}, ) # please add some check logic here by yourself diff --git a/packages/typespec-python/test/azure/generated/typetest-model-visibility/generated_tests/test_visibility_async.py b/packages/typespec-python/test/azure/generated/typetest-model-visibility/generated_tests/test_visibility_async.py index 5984e18954f..1461bd28e38 100644 --- a/packages/typespec-python/test/azure/generated/typetest-model-visibility/generated_tests/test_visibility_async.py +++ b/packages/typespec-python/test/azure/generated/typetest-model-visibility/generated_tests/test_visibility_async.py @@ -12,7 +12,8 @@ class TestVisibilityAsync(VisibilityClientTestBaseAsync): async def test_get_model(self, visibility_endpoint): client = self.create_async_client(endpoint=visibility_endpoint) response = await client.get_model( - input={"createProp": ["str"], "deleteProp": bool, "queryProp": 0, "readProp": "str", "updateProp": [0]}, + input={"createProp": ["str"], "deleteProp": bool, "readProp": "str", "updateProp": [0]}, + query_prop=0, ) # please add some check logic here by yourself @@ -23,7 +24,8 @@ async def test_get_model(self, visibility_endpoint): async def test_head_model(self, visibility_endpoint): client = self.create_async_client(endpoint=visibility_endpoint) response = await client.head_model( - input={"createProp": ["str"], "deleteProp": bool, "queryProp": 0, "readProp": "str", "updateProp": [0]}, + input={"createProp": ["str"], "deleteProp": bool, "readProp": "str", "updateProp": [0]}, + query_prop=0, ) # please add some check logic here by yourself @@ -34,7 +36,7 @@ async def test_head_model(self, visibility_endpoint): async def test_put_model(self, visibility_endpoint): client = self.create_async_client(endpoint=visibility_endpoint) response = await client.put_model( - input={"createProp": ["str"], "deleteProp": bool, "queryProp": 0, "readProp": "str", "updateProp": [0]}, + input={"createProp": ["str"], "deleteProp": bool, "readProp": "str", "updateProp": [0]}, ) # please add some check logic here by yourself @@ -45,7 +47,7 @@ async def test_put_model(self, visibility_endpoint): async def test_patch_model(self, visibility_endpoint): client = self.create_async_client(endpoint=visibility_endpoint) response = await client.patch_model( - input={"createProp": ["str"], "deleteProp": bool, "queryProp": 0, "readProp": "str", "updateProp": [0]}, + input={"createProp": ["str"], "deleteProp": bool, "readProp": "str", "updateProp": [0]}, ) # please add some check logic here by yourself @@ -56,7 +58,7 @@ async def test_patch_model(self, visibility_endpoint): async def test_post_model(self, visibility_endpoint): client = self.create_async_client(endpoint=visibility_endpoint) response = await client.post_model( - input={"createProp": ["str"], "deleteProp": bool, "queryProp": 0, "readProp": "str", "updateProp": [0]}, + input={"createProp": ["str"], "deleteProp": bool, "readProp": "str", "updateProp": [0]}, ) # please add some check logic here by yourself @@ -67,7 +69,7 @@ async def test_post_model(self, visibility_endpoint): async def test_delete_model(self, visibility_endpoint): client = self.create_async_client(endpoint=visibility_endpoint) response = await client.delete_model( - input={"createProp": ["str"], "deleteProp": bool, "queryProp": 0, "readProp": "str", "updateProp": [0]}, + input={"createProp": ["str"], "deleteProp": bool, "readProp": "str", "updateProp": [0]}, ) # please add some check logic here by yourself diff --git a/packages/typespec-python/test/azure/generated/typetest-model-visibility/typetest/model/visibility/_operations/_operations.py b/packages/typespec-python/test/azure/generated/typetest-model-visibility/typetest/model/visibility/_operations/_operations.py index 28afbc61954..e8f318edb5c 100644 --- a/packages/typespec-python/test/azure/generated/typetest-model-visibility/typetest/model/visibility/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-model-visibility/typetest/model/visibility/_operations/_operations.py @@ -36,8 +36,9 @@ _SERIALIZER.client_side_validation = False -def build_visibility_get_model_request(**kwargs: Any) -> HttpRequest: +def build_visibility_get_model_request(*, query_prop: int, **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)) accept = _headers.pop("Accept", "application/json") @@ -45,26 +46,33 @@ def build_visibility_get_model_request(**kwargs: Any) -> HttpRequest: # Construct URL _url = "/type/model/visibility" + # Construct parameters + _params["queryProp"] = _SERIALIZER.query("query_prop", query_prop, "int") + # 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="GET", url=_url, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_visibility_head_model_request(**kwargs: Any) -> HttpRequest: +def build_visibility_head_model_request(*, query_prop: int, **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)) # Construct URL _url = "/type/model/visibility" + # Construct parameters + _params["queryProp"] = _SERIALIZER.query("query_prop", query_prop, "int") + # Construct headers if content_type is not None: _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - return HttpRequest(method="HEAD", url=_url, headers=_headers, **kwargs) + return HttpRequest(method="HEAD", url=_url, params=_params, headers=_headers, **kwargs) def build_visibility_put_model_request(**kwargs: Any) -> HttpRequest: @@ -144,12 +152,14 @@ class VisibilityClientOperationsMixin(VisibilityClientMixinABC): @overload def get_model( - self, input: _models.VisibilityModel, *, content_type: str = "application/json", **kwargs: Any + self, input: _models.VisibilityModel, *, query_prop: int, content_type: str = "application/json", **kwargs: Any ) -> _models.VisibilityModel: """get_model. :param input: Required. :type input: ~typetest.model.visibility.models.VisibilityModel + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -160,12 +170,14 @@ def get_model( @overload def get_model( - self, input: JSON, *, content_type: str = "application/json", **kwargs: Any + self, input: JSON, *, query_prop: int, content_type: str = "application/json", **kwargs: Any ) -> _models.VisibilityModel: """get_model. :param input: Required. :type input: JSON + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -176,12 +188,14 @@ def get_model( @overload def get_model( - self, input: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + self, input: IO[bytes], *, query_prop: int, content_type: str = "application/json", **kwargs: Any ) -> _models.VisibilityModel: """get_model. :param input: Required. :type input: IO[bytes] + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -192,12 +206,14 @@ def get_model( @distributed_trace def get_model( - self, input: Union[_models.VisibilityModel, JSON, IO[bytes]], **kwargs: Any + self, input: Union[_models.VisibilityModel, JSON, IO[bytes]], *, query_prop: int, **kwargs: Any ) -> _models.VisibilityModel: """get_model. :param input: Is one of the following types: VisibilityModel, JSON, IO[bytes] Required. :type input: ~typetest.model.visibility.models.VisibilityModel or JSON or IO[bytes] + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :return: VisibilityModel. The VisibilityModel is compatible with MutableMapping :rtype: ~typetest.model.visibility.models.VisibilityModel :raises ~azure.core.exceptions.HttpResponseError: @@ -224,6 +240,7 @@ def get_model( _content = json.dumps(input, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_visibility_get_model_request( + query_prop=query_prop, content_type=content_type, content=_content, headers=_headers, @@ -262,12 +279,14 @@ def get_model( @overload def head_model( - self, input: _models.VisibilityModel, *, content_type: str = "application/json", **kwargs: Any + self, input: _models.VisibilityModel, *, query_prop: int, content_type: str = "application/json", **kwargs: Any ) -> bool: """head_model. :param input: Required. :type input: ~typetest.model.visibility.models.VisibilityModel + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -277,11 +296,15 @@ def head_model( """ @overload - def head_model(self, input: JSON, *, content_type: str = "application/json", **kwargs: Any) -> bool: + def head_model( + self, input: JSON, *, query_prop: int, content_type: str = "application/json", **kwargs: Any + ) -> bool: """head_model. :param input: Required. :type input: JSON + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -291,11 +314,15 @@ def head_model(self, input: JSON, *, content_type: str = "application/json", **k """ @overload - def head_model(self, input: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> bool: + def head_model( + self, input: IO[bytes], *, query_prop: int, content_type: str = "application/json", **kwargs: Any + ) -> bool: """head_model. :param input: Required. :type input: IO[bytes] + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -305,11 +332,15 @@ def head_model(self, input: IO[bytes], *, content_type: str = "application/json" """ @distributed_trace - def head_model(self, input: Union[_models.VisibilityModel, JSON, IO[bytes]], **kwargs: Any) -> bool: + def head_model( + self, input: Union[_models.VisibilityModel, JSON, IO[bytes]], *, query_prop: int, **kwargs: Any + ) -> bool: """head_model. :param input: Is one of the following types: VisibilityModel, JSON, IO[bytes] Required. :type input: ~typetest.model.visibility.models.VisibilityModel or JSON or IO[bytes] + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :return: bool :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: @@ -336,6 +367,7 @@ def head_model(self, input: Union[_models.VisibilityModel, JSON, IO[bytes]], **k _content = json.dumps(input, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_visibility_head_model_request( + query_prop=query_prop, content_type=content_type, content=_content, headers=_headers, diff --git a/packages/typespec-python/test/azure/generated/typetest-model-visibility/typetest/model/visibility/aio/_operations/_operations.py b/packages/typespec-python/test/azure/generated/typetest-model-visibility/typetest/model/visibility/aio/_operations/_operations.py index f89736ae8d9..d6089a5e6a9 100644 --- a/packages/typespec-python/test/azure/generated/typetest-model-visibility/typetest/model/visibility/aio/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-model-visibility/typetest/model/visibility/aio/_operations/_operations.py @@ -46,12 +46,14 @@ class VisibilityClientOperationsMixin(VisibilityClientMixinABC): @overload async def get_model( - self, input: _models.VisibilityModel, *, content_type: str = "application/json", **kwargs: Any + self, input: _models.VisibilityModel, *, query_prop: int, content_type: str = "application/json", **kwargs: Any ) -> _models.VisibilityModel: """get_model. :param input: Required. :type input: ~typetest.model.visibility.models.VisibilityModel + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -62,12 +64,14 @@ async def get_model( @overload async def get_model( - self, input: JSON, *, content_type: str = "application/json", **kwargs: Any + self, input: JSON, *, query_prop: int, content_type: str = "application/json", **kwargs: Any ) -> _models.VisibilityModel: """get_model. :param input: Required. :type input: JSON + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -78,12 +82,14 @@ async def get_model( @overload async def get_model( - self, input: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + self, input: IO[bytes], *, query_prop: int, content_type: str = "application/json", **kwargs: Any ) -> _models.VisibilityModel: """get_model. :param input: Required. :type input: IO[bytes] + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -94,12 +100,14 @@ async def get_model( @distributed_trace_async async def get_model( - self, input: Union[_models.VisibilityModel, JSON, IO[bytes]], **kwargs: Any + self, input: Union[_models.VisibilityModel, JSON, IO[bytes]], *, query_prop: int, **kwargs: Any ) -> _models.VisibilityModel: """get_model. :param input: Is one of the following types: VisibilityModel, JSON, IO[bytes] Required. :type input: ~typetest.model.visibility.models.VisibilityModel or JSON or IO[bytes] + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :return: VisibilityModel. The VisibilityModel is compatible with MutableMapping :rtype: ~typetest.model.visibility.models.VisibilityModel :raises ~azure.core.exceptions.HttpResponseError: @@ -126,6 +134,7 @@ async def get_model( _content = json.dumps(input, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_visibility_get_model_request( + query_prop=query_prop, content_type=content_type, content=_content, headers=_headers, @@ -164,12 +173,14 @@ async def get_model( @overload async def head_model( - self, input: _models.VisibilityModel, *, content_type: str = "application/json", **kwargs: Any + self, input: _models.VisibilityModel, *, query_prop: int, content_type: str = "application/json", **kwargs: Any ) -> bool: """head_model. :param input: Required. :type input: ~typetest.model.visibility.models.VisibilityModel + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -179,11 +190,15 @@ async def head_model( """ @overload - async def head_model(self, input: JSON, *, content_type: str = "application/json", **kwargs: Any) -> bool: + async def head_model( + self, input: JSON, *, query_prop: int, content_type: str = "application/json", **kwargs: Any + ) -> bool: """head_model. :param input: Required. :type input: JSON + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -193,11 +208,15 @@ async def head_model(self, input: JSON, *, content_type: str = "application/json """ @overload - async def head_model(self, input: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> bool: + async def head_model( + self, input: IO[bytes], *, query_prop: int, content_type: str = "application/json", **kwargs: Any + ) -> bool: """head_model. :param input: Required. :type input: IO[bytes] + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -207,11 +226,15 @@ async def head_model(self, input: IO[bytes], *, content_type: str = "application """ @distributed_trace_async - async def head_model(self, input: Union[_models.VisibilityModel, JSON, IO[bytes]], **kwargs: Any) -> bool: + async def head_model( + self, input: Union[_models.VisibilityModel, JSON, IO[bytes]], *, query_prop: int, **kwargs: Any + ) -> bool: """head_model. :param input: Is one of the following types: VisibilityModel, JSON, IO[bytes] Required. :type input: ~typetest.model.visibility.models.VisibilityModel or JSON or IO[bytes] + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :return: bool :rtype: bool :raises ~azure.core.exceptions.HttpResponseError: @@ -238,6 +261,7 @@ async def head_model(self, input: Union[_models.VisibilityModel, JSON, IO[bytes] _content = json.dumps(input, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_visibility_head_model_request( + query_prop=query_prop, content_type=content_type, content=_content, headers=_headers, diff --git a/packages/typespec-python/test/azure/generated/typetest-model-visibility/typetest/model/visibility/models/_models.py b/packages/typespec-python/test/azure/generated/typetest-model-visibility/typetest/model/visibility/models/_models.py index e9e648696dc..a302369b8a6 100644 --- a/packages/typespec-python/test/azure/generated/typetest-model-visibility/typetest/model/visibility/models/_models.py +++ b/packages/typespec-python/test/azure/generated/typetest-model-visibility/typetest/model/visibility/models/_models.py @@ -27,8 +27,6 @@ class VisibilityModel(_model_base.Model): :ivar read_prop: Required string, illustrating a readonly property. Required. :vartype read_prop: str - :ivar query_prop: Required int32, illustrating a query property. Required. - :vartype query_prop: int :ivar create_prop: Required string[], illustrating a create property. Required. :vartype create_prop: list[str] :ivar update_prop: Required int32[], illustrating a update property. Required. @@ -39,8 +37,6 @@ class VisibilityModel(_model_base.Model): read_prop: str = rest_field(name="readProp", visibility=["read"]) """Required string, illustrating a readonly property. Required.""" - query_prop: int = rest_field(name="queryProp", visibility=["query"]) - """Required int32, illustrating a query property. Required.""" create_prop: List[str] = rest_field(name="createProp", visibility=["create"]) """Required string[], illustrating a create property. Required.""" update_prop: List[int] = rest_field(name="updateProp", visibility=["update"]) @@ -52,7 +48,6 @@ class VisibilityModel(_model_base.Model): def __init__( self, *, - query_prop: int, create_prop: List[str], update_prop: List[int], delete_prop: bool, diff --git a/packages/typespec-python/test/azure/generated/versioning-added/versioning/added/_client.py b/packages/typespec-python/test/azure/generated/versioning-added/versioning/added/_client.py index 533f0edafe1..67c0491875a 100644 --- a/packages/typespec-python/test/azure/generated/versioning-added/versioning/added/_client.py +++ b/packages/typespec-python/test/azure/generated/versioning-added/versioning/added/_client.py @@ -76,7 +76,7 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), } diff --git a/packages/typespec-python/test/azure/generated/versioning-added/versioning/added/aio/_client.py b/packages/typespec-python/test/azure/generated/versioning-added/versioning/added/aio/_client.py index ef35886e38d..b501d5f0315 100644 --- a/packages/typespec-python/test/azure/generated/versioning-added/versioning/added/aio/_client.py +++ b/packages/typespec-python/test/azure/generated/versioning-added/versioning/added/aio/_client.py @@ -78,7 +78,7 @@ def send_request( request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), } diff --git a/packages/typespec-python/test/azure/generated/versioning-added/versioning/added/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/versioning-added/versioning/added/aio/operations/_operations.py index 9c008419b03..c290b40239a 100644 --- a/packages/typespec-python/test/azure/generated/versioning-added/versioning/added/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/versioning-added/versioning/added/aio/operations/_operations.py @@ -149,7 +149,7 @@ async def v2_in_interface(self, body: Union[_models.ModelV2, JSON, IO[bytes]], * params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -283,7 +283,7 @@ async def v1( params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -400,7 +400,7 @@ async def v2(self, body: Union[_models.ModelV2, JSON, IO[bytes]], **kwargs: Any) params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) diff --git a/packages/typespec-python/test/azure/generated/versioning-added/versioning/added/operations/_operations.py b/packages/typespec-python/test/azure/generated/versioning-added/versioning/added/operations/_operations.py index 48e11ff245e..9dd37a4da3b 100644 --- a/packages/typespec-python/test/azure/generated/versioning-added/versioning/added/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/versioning-added/versioning/added/operations/_operations.py @@ -196,7 +196,7 @@ def v2_in_interface(self, body: Union[_models.ModelV2, JSON, IO[bytes]], **kwarg params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -328,7 +328,7 @@ def v1(self, body: Union[_models.ModelV1, JSON, IO[bytes]], *, header_v2: str, * params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -443,7 +443,7 @@ def v2(self, body: Union[_models.ModelV2, JSON, IO[bytes]], **kwargs: Any) -> _m params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) diff --git a/packages/typespec-python/test/azure/generated/versioning-madeoptional/versioning/madeoptional/_client.py b/packages/typespec-python/test/azure/generated/versioning-madeoptional/versioning/madeoptional/_client.py index aa4775d5293..03ba49f9b02 100644 --- a/packages/typespec-python/test/azure/generated/versioning-madeoptional/versioning/madeoptional/_client.py +++ b/packages/typespec-python/test/azure/generated/versioning-madeoptional/versioning/madeoptional/_client.py @@ -73,7 +73,7 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), } diff --git a/packages/typespec-python/test/azure/generated/versioning-madeoptional/versioning/madeoptional/_operations/_operations.py b/packages/typespec-python/test/azure/generated/versioning-madeoptional/versioning/madeoptional/_operations/_operations.py index 8b20bf12b2b..c3937af67ee 100644 --- a/packages/typespec-python/test/azure/generated/versioning-madeoptional/versioning/madeoptional/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/versioning-madeoptional/versioning/madeoptional/_operations/_operations.py @@ -162,7 +162,7 @@ def test( params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) diff --git a/packages/typespec-python/test/azure/generated/versioning-madeoptional/versioning/madeoptional/aio/_client.py b/packages/typespec-python/test/azure/generated/versioning-madeoptional/versioning/madeoptional/aio/_client.py index 8683ad177e7..19075d10b0b 100644 --- a/packages/typespec-python/test/azure/generated/versioning-madeoptional/versioning/madeoptional/aio/_client.py +++ b/packages/typespec-python/test/azure/generated/versioning-madeoptional/versioning/madeoptional/aio/_client.py @@ -75,7 +75,7 @@ def send_request( request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), } diff --git a/packages/typespec-python/test/azure/generated/versioning-madeoptional/versioning/madeoptional/aio/_operations/_operations.py b/packages/typespec-python/test/azure/generated/versioning-madeoptional/versioning/madeoptional/aio/_operations/_operations.py index 7d9e2af12ef..63ffc828d74 100644 --- a/packages/typespec-python/test/azure/generated/versioning-madeoptional/versioning/madeoptional/aio/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/versioning-madeoptional/versioning/madeoptional/aio/_operations/_operations.py @@ -138,7 +138,7 @@ async def test( params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) diff --git a/packages/typespec-python/test/azure/generated/versioning-removed/versioning/removed/_client.py b/packages/typespec-python/test/azure/generated/versioning-removed/versioning/removed/_client.py index 38433fc1603..87ee6a67e07 100644 --- a/packages/typespec-python/test/azure/generated/versioning-removed/versioning/removed/_client.py +++ b/packages/typespec-python/test/azure/generated/versioning-removed/versioning/removed/_client.py @@ -73,7 +73,7 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), } diff --git a/packages/typespec-python/test/azure/generated/versioning-removed/versioning/removed/_operations/_operations.py b/packages/typespec-python/test/azure/generated/versioning-removed/versioning/removed/_operations/_operations.py index 29b54d36fe3..1d01ba1a108 100644 --- a/packages/typespec-python/test/azure/generated/versioning-removed/versioning/removed/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/versioning-removed/versioning/removed/_operations/_operations.py @@ -152,7 +152,7 @@ def v2(self, body: Union[_models.ModelV2, JSON, IO[bytes]], **kwargs: Any) -> _m params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -269,7 +269,7 @@ def model_v3(self, body: Union[_models.ModelV3, JSON, IO[bytes]], **kwargs: Any) params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) diff --git a/packages/typespec-python/test/azure/generated/versioning-removed/versioning/removed/aio/_client.py b/packages/typespec-python/test/azure/generated/versioning-removed/versioning/removed/aio/_client.py index 0f4e9c13e7e..6859849b3e8 100644 --- a/packages/typespec-python/test/azure/generated/versioning-removed/versioning/removed/aio/_client.py +++ b/packages/typespec-python/test/azure/generated/versioning-removed/versioning/removed/aio/_client.py @@ -75,7 +75,7 @@ def send_request( request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), } diff --git a/packages/typespec-python/test/azure/generated/versioning-removed/versioning/removed/aio/_operations/_operations.py b/packages/typespec-python/test/azure/generated/versioning-removed/versioning/removed/aio/_operations/_operations.py index 0210a803aec..28dd171ad5a 100644 --- a/packages/typespec-python/test/azure/generated/versioning-removed/versioning/removed/aio/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/versioning-removed/versioning/removed/aio/_operations/_operations.py @@ -118,7 +118,7 @@ async def v2(self, body: Union[_models.ModelV2, JSON, IO[bytes]], **kwargs: Any) params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -237,7 +237,7 @@ async def model_v3(self, body: Union[_models.ModelV3, JSON, IO[bytes]], **kwargs params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) diff --git a/packages/typespec-python/test/azure/generated/versioning-renamedfrom/versioning/renamedfrom/_client.py b/packages/typespec-python/test/azure/generated/versioning-renamedfrom/versioning/renamedfrom/_client.py index 37598d85079..fff7ebcfa17 100644 --- a/packages/typespec-python/test/azure/generated/versioning-renamedfrom/versioning/renamedfrom/_client.py +++ b/packages/typespec-python/test/azure/generated/versioning-renamedfrom/versioning/renamedfrom/_client.py @@ -76,7 +76,7 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), } diff --git a/packages/typespec-python/test/azure/generated/versioning-renamedfrom/versioning/renamedfrom/aio/_client.py b/packages/typespec-python/test/azure/generated/versioning-renamedfrom/versioning/renamedfrom/aio/_client.py index b56ee48aac4..df806dee9c1 100644 --- a/packages/typespec-python/test/azure/generated/versioning-renamedfrom/versioning/renamedfrom/aio/_client.py +++ b/packages/typespec-python/test/azure/generated/versioning-renamedfrom/versioning/renamedfrom/aio/_client.py @@ -78,7 +78,7 @@ def send_request( request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), } diff --git a/packages/typespec-python/test/azure/generated/versioning-renamedfrom/versioning/renamedfrom/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/versioning-renamedfrom/versioning/renamedfrom/aio/operations/_operations.py index f7b5734594d..3ec20a4e6a7 100644 --- a/packages/typespec-python/test/azure/generated/versioning-renamedfrom/versioning/renamedfrom/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/versioning-renamedfrom/versioning/renamedfrom/aio/operations/_operations.py @@ -145,7 +145,7 @@ async def new_op_in_new_interface( params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -276,7 +276,7 @@ async def new_op( params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) diff --git a/packages/typespec-python/test/azure/generated/versioning-renamedfrom/versioning/renamedfrom/operations/_operations.py b/packages/typespec-python/test/azure/generated/versioning-renamedfrom/versioning/renamedfrom/operations/_operations.py index 6ee48810e58..d9c0e9b7a0c 100644 --- a/packages/typespec-python/test/azure/generated/versioning-renamedfrom/versioning/renamedfrom/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/versioning-renamedfrom/versioning/renamedfrom/operations/_operations.py @@ -181,7 +181,7 @@ def new_op_in_new_interface( params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -312,7 +312,7 @@ def new_op( params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) diff --git a/packages/typespec-python/test/azure/generated/versioning-returntypechangedfrom/versioning/returntypechangedfrom/_client.py b/packages/typespec-python/test/azure/generated/versioning-returntypechangedfrom/versioning/returntypechangedfrom/_client.py index 6fd6505b34c..b4b0b372342 100644 --- a/packages/typespec-python/test/azure/generated/versioning-returntypechangedfrom/versioning/returntypechangedfrom/_client.py +++ b/packages/typespec-python/test/azure/generated/versioning-returntypechangedfrom/versioning/returntypechangedfrom/_client.py @@ -75,7 +75,7 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), } diff --git a/packages/typespec-python/test/azure/generated/versioning-returntypechangedfrom/versioning/returntypechangedfrom/_operations/_operations.py b/packages/typespec-python/test/azure/generated/versioning-returntypechangedfrom/versioning/returntypechangedfrom/_operations/_operations.py index a7cb61185a1..f4051a07a81 100644 --- a/packages/typespec-python/test/azure/generated/versioning-returntypechangedfrom/versioning/returntypechangedfrom/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/versioning-returntypechangedfrom/versioning/returntypechangedfrom/_operations/_operations.py @@ -1,4 +1,5 @@ # coding=utf-8 +import json import sys from typing import Any, Callable, Dict, Optional, TypeVar @@ -17,7 +18,7 @@ from azure.core.tracing.decorator import distributed_trace from azure.core.utils import case_insensitive_dict -from .._model_base import _deserialize +from .._model_base import SdkJSONEncoder, _deserialize from .._serialization import Serializer from .._vendor import ReturnTypeChangedFromClientMixinABC @@ -42,7 +43,7 @@ def build_return_type_changed_from_test_request(**kwargs: Any) -> HttpRequest: _url = "/test" # Construct headers - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _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) @@ -71,10 +72,10 @@ def test(self, body: str, **kwargs: Any) -> str: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "text/plain")) + content_type: str = kwargs.pop("content_type", _headers.pop("content-type", "application/json")) cls: ClsType[str] = kwargs.pop("cls", None) - _content = body + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_return_type_changed_from_test_request( content_type=content_type, @@ -83,7 +84,7 @@ def test(self, body: str, **kwargs: Any) -> str: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) diff --git a/packages/typespec-python/test/azure/generated/versioning-returntypechangedfrom/versioning/returntypechangedfrom/aio/_client.py b/packages/typespec-python/test/azure/generated/versioning-returntypechangedfrom/versioning/returntypechangedfrom/aio/_client.py index b606f9f19c7..17c1c60ed6a 100644 --- a/packages/typespec-python/test/azure/generated/versioning-returntypechangedfrom/versioning/returntypechangedfrom/aio/_client.py +++ b/packages/typespec-python/test/azure/generated/versioning-returntypechangedfrom/versioning/returntypechangedfrom/aio/_client.py @@ -77,7 +77,7 @@ def send_request( request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), } diff --git a/packages/typespec-python/test/azure/generated/versioning-returntypechangedfrom/versioning/returntypechangedfrom/aio/_operations/_operations.py b/packages/typespec-python/test/azure/generated/versioning-returntypechangedfrom/versioning/returntypechangedfrom/aio/_operations/_operations.py index 38190cf9d09..a3aaf504c08 100644 --- a/packages/typespec-python/test/azure/generated/versioning-returntypechangedfrom/versioning/returntypechangedfrom/aio/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/versioning-returntypechangedfrom/versioning/returntypechangedfrom/aio/_operations/_operations.py @@ -1,5 +1,6 @@ # pylint: disable=line-too-long,useless-suppression # coding=utf-8 +import json import sys from typing import Any, Callable, Dict, Optional, TypeVar @@ -18,7 +19,7 @@ from azure.core.tracing.decorator_async import distributed_trace_async from azure.core.utils import case_insensitive_dict -from ..._model_base import _deserialize +from ..._model_base import SdkJSONEncoder, _deserialize from ..._operations._operations import build_return_type_changed_from_test_request from .._vendor import ReturnTypeChangedFromClientMixinABC @@ -53,10 +54,10 @@ async def test(self, body: str, **kwargs: Any) -> str: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "text/plain")) + content_type: str = kwargs.pop("content_type", _headers.pop("content-type", "application/json")) cls: ClsType[str] = kwargs.pop("cls", None) - _content = body + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_return_type_changed_from_test_request( content_type=content_type, @@ -65,7 +66,7 @@ async def test(self, body: str, **kwargs: Any) -> str: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) diff --git a/packages/typespec-python/test/azure/generated/versioning-typechangedfrom/versioning/typechangedfrom/_client.py b/packages/typespec-python/test/azure/generated/versioning-typechangedfrom/versioning/typechangedfrom/_client.py index 062619aa333..2bef9bf7dce 100644 --- a/packages/typespec-python/test/azure/generated/versioning-typechangedfrom/versioning/typechangedfrom/_client.py +++ b/packages/typespec-python/test/azure/generated/versioning-typechangedfrom/versioning/typechangedfrom/_client.py @@ -73,7 +73,7 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), } diff --git a/packages/typespec-python/test/azure/generated/versioning-typechangedfrom/versioning/typechangedfrom/_operations/_operations.py b/packages/typespec-python/test/azure/generated/versioning-typechangedfrom/versioning/typechangedfrom/_operations/_operations.py index 7214d2c1503..ea3612cda5b 100644 --- a/packages/typespec-python/test/azure/generated/versioning-typechangedfrom/versioning/typechangedfrom/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/versioning-typechangedfrom/versioning/typechangedfrom/_operations/_operations.py @@ -154,7 +154,7 @@ def test(self, body: Union[_models.TestModel, JSON, IO[bytes]], *, param: str, * params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) diff --git a/packages/typespec-python/test/azure/generated/versioning-typechangedfrom/versioning/typechangedfrom/aio/_client.py b/packages/typespec-python/test/azure/generated/versioning-typechangedfrom/versioning/typechangedfrom/aio/_client.py index fb4b4c901ec..470ba4968b1 100644 --- a/packages/typespec-python/test/azure/generated/versioning-typechangedfrom/versioning/typechangedfrom/aio/_client.py +++ b/packages/typespec-python/test/azure/generated/versioning-typechangedfrom/versioning/typechangedfrom/aio/_client.py @@ -75,7 +75,7 @@ def send_request( request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), } diff --git a/packages/typespec-python/test/azure/generated/versioning-typechangedfrom/versioning/typechangedfrom/aio/_operations/_operations.py b/packages/typespec-python/test/azure/generated/versioning-typechangedfrom/versioning/typechangedfrom/aio/_operations/_operations.py index d50fcbe07e8..148c6279839 100644 --- a/packages/typespec-python/test/azure/generated/versioning-typechangedfrom/versioning/typechangedfrom/aio/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/versioning-typechangedfrom/versioning/typechangedfrom/aio/_operations/_operations.py @@ -133,7 +133,7 @@ async def test( params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) diff --git a/packages/typespec-python/test/unbranded/generated/encode-bytes/encode/bytes/responsebody/aio/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/encode-bytes/encode/bytes/responsebody/aio/operations/_operations.py index 585ebb7db42..0a1395f03f3 100644 --- a/packages/typespec-python/test/unbranded/generated/encode-bytes/encode/bytes/responsebody/aio/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/encode-bytes/encode/bytes/responsebody/aio/operations/_operations.py @@ -313,7 +313,7 @@ async def base64_url(self, **kwargs: Any) -> bytes: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(bytes, response.json(), format="base64") + deserialized = _deserialize(bytes, response.json(), format="base64url") if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore diff --git a/packages/typespec-python/test/unbranded/generated/encode-bytes/encode/bytes/responsebody/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/encode-bytes/encode/bytes/responsebody/operations/_operations.py index c780a372d77..14e44bdabc1 100644 --- a/packages/typespec-python/test/unbranded/generated/encode-bytes/encode/bytes/responsebody/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/encode-bytes/encode/bytes/responsebody/operations/_operations.py @@ -380,7 +380,7 @@ def base64_url(self, **kwargs: Any) -> bytes: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(bytes, response.json(), format="base64") + deserialized = _deserialize(bytes, response.json(), format="base64url") if cls: return cls(pipeline_response, deserialized, response_headers) # type: ignore diff --git a/packages/typespec-python/test/unbranded/generated/headasbooleanfalse/headasbooleanfalse/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/headasbooleanfalse/headasbooleanfalse/_operations/_operations.py index bbea08f3d0a..8f818b7dcbc 100644 --- a/packages/typespec-python/test/unbranded/generated/headasbooleanfalse/headasbooleanfalse/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/headasbooleanfalse/headasbooleanfalse/_operations/_operations.py @@ -35,8 +35,9 @@ _SERIALIZER.client_side_validation = False -def build_visibility_get_model_request(**kwargs: Any) -> HttpRequest: +def build_visibility_get_model_request(*, query_prop: int, **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)) accept = _headers.pop("Accept", "application/json") @@ -44,26 +45,33 @@ def build_visibility_get_model_request(**kwargs: Any) -> HttpRequest: # Construct URL _url = "/type/model/visibility" + # Construct parameters + _params["queryProp"] = _SERIALIZER.query("query_prop", query_prop, "int") + # 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="GET", url=_url, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_visibility_head_model_request(**kwargs: Any) -> HttpRequest: +def build_visibility_head_model_request(*, query_prop: int, **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)) # Construct URL _url = "/type/model/visibility" + # Construct parameters + _params["queryProp"] = _SERIALIZER.query("query_prop", query_prop, "int") + # Construct headers if content_type is not None: _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - return HttpRequest(method="HEAD", url=_url, headers=_headers, **kwargs) + return HttpRequest(method="HEAD", url=_url, params=_params, headers=_headers, **kwargs) def build_visibility_put_model_request(**kwargs: Any) -> HttpRequest: @@ -143,12 +151,14 @@ class VisibilityClientOperationsMixin(VisibilityClientMixinABC): @overload def get_model( - self, input: _models.VisibilityModel, *, content_type: str = "application/json", **kwargs: Any + self, input: _models.VisibilityModel, *, query_prop: int, content_type: str = "application/json", **kwargs: Any ) -> _models.VisibilityModel: """get_model. :param input: Required. :type input: ~headasbooleanfalse.models.VisibilityModel + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -159,12 +169,14 @@ def get_model( @overload def get_model( - self, input: JSON, *, content_type: str = "application/json", **kwargs: Any + self, input: JSON, *, query_prop: int, content_type: str = "application/json", **kwargs: Any ) -> _models.VisibilityModel: """get_model. :param input: Required. :type input: JSON + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -175,12 +187,14 @@ def get_model( @overload def get_model( - self, input: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + self, input: IO[bytes], *, query_prop: int, content_type: str = "application/json", **kwargs: Any ) -> _models.VisibilityModel: """get_model. :param input: Required. :type input: IO[bytes] + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -190,12 +204,14 @@ def get_model( """ def get_model( - self, input: Union[_models.VisibilityModel, JSON, IO[bytes]], **kwargs: Any + self, input: Union[_models.VisibilityModel, JSON, IO[bytes]], *, query_prop: int, **kwargs: Any ) -> _models.VisibilityModel: """get_model. :param input: Is one of the following types: VisibilityModel, JSON, IO[bytes] Required. :type input: ~headasbooleanfalse.models.VisibilityModel or JSON or IO[bytes] + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :return: VisibilityModel. The VisibilityModel is compatible with MutableMapping :rtype: ~headasbooleanfalse.models.VisibilityModel :raises ~corehttp.exceptions.HttpResponseError: @@ -222,6 +238,7 @@ def get_model( _content = json.dumps(input, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_visibility_get_model_request( + query_prop=query_prop, content_type=content_type, content=_content, headers=_headers, @@ -258,12 +275,14 @@ def get_model( @overload def head_model( - self, input: _models.VisibilityModel, *, content_type: str = "application/json", **kwargs: Any + self, input: _models.VisibilityModel, *, query_prop: int, content_type: str = "application/json", **kwargs: Any ) -> None: """head_model. :param input: Required. :type input: ~headasbooleanfalse.models.VisibilityModel + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -273,11 +292,15 @@ def head_model( """ @overload - def head_model(self, input: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + def head_model( + self, input: JSON, *, query_prop: int, content_type: str = "application/json", **kwargs: Any + ) -> None: """head_model. :param input: Required. :type input: JSON + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -287,11 +310,15 @@ def head_model(self, input: JSON, *, content_type: str = "application/json", **k """ @overload - def head_model(self, input: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + def head_model( + self, input: IO[bytes], *, query_prop: int, content_type: str = "application/json", **kwargs: Any + ) -> None: """head_model. :param input: Required. :type input: IO[bytes] + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -301,12 +328,14 @@ def head_model(self, input: IO[bytes], *, content_type: str = "application/json" """ def head_model( # pylint: disable=inconsistent-return-statements - self, input: Union[_models.VisibilityModel, JSON, IO[bytes]], **kwargs: Any + self, input: Union[_models.VisibilityModel, JSON, IO[bytes]], *, query_prop: int, **kwargs: Any ) -> None: """head_model. :param input: Is one of the following types: VisibilityModel, JSON, IO[bytes] Required. :type input: ~headasbooleanfalse.models.VisibilityModel or JSON or IO[bytes] + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :return: None :rtype: None :raises ~corehttp.exceptions.HttpResponseError: @@ -333,6 +362,7 @@ def head_model( # pylint: disable=inconsistent-return-statements _content = json.dumps(input, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_visibility_head_model_request( + query_prop=query_prop, content_type=content_type, content=_content, headers=_headers, diff --git a/packages/typespec-python/test/unbranded/generated/headasbooleanfalse/headasbooleanfalse/aio/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/headasbooleanfalse/headasbooleanfalse/aio/_operations/_operations.py index 4b7253b8bda..5aeb5ecf18b 100644 --- a/packages/typespec-python/test/unbranded/generated/headasbooleanfalse/headasbooleanfalse/aio/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/headasbooleanfalse/headasbooleanfalse/aio/_operations/_operations.py @@ -44,12 +44,14 @@ class VisibilityClientOperationsMixin(VisibilityClientMixinABC): @overload async def get_model( - self, input: _models.VisibilityModel, *, content_type: str = "application/json", **kwargs: Any + self, input: _models.VisibilityModel, *, query_prop: int, content_type: str = "application/json", **kwargs: Any ) -> _models.VisibilityModel: """get_model. :param input: Required. :type input: ~headasbooleanfalse.models.VisibilityModel + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -60,12 +62,14 @@ async def get_model( @overload async def get_model( - self, input: JSON, *, content_type: str = "application/json", **kwargs: Any + self, input: JSON, *, query_prop: int, content_type: str = "application/json", **kwargs: Any ) -> _models.VisibilityModel: """get_model. :param input: Required. :type input: JSON + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -76,12 +80,14 @@ async def get_model( @overload async def get_model( - self, input: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + self, input: IO[bytes], *, query_prop: int, content_type: str = "application/json", **kwargs: Any ) -> _models.VisibilityModel: """get_model. :param input: Required. :type input: IO[bytes] + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -91,12 +97,14 @@ async def get_model( """ async def get_model( - self, input: Union[_models.VisibilityModel, JSON, IO[bytes]], **kwargs: Any + self, input: Union[_models.VisibilityModel, JSON, IO[bytes]], *, query_prop: int, **kwargs: Any ) -> _models.VisibilityModel: """get_model. :param input: Is one of the following types: VisibilityModel, JSON, IO[bytes] Required. :type input: ~headasbooleanfalse.models.VisibilityModel or JSON or IO[bytes] + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :return: VisibilityModel. The VisibilityModel is compatible with MutableMapping :rtype: ~headasbooleanfalse.models.VisibilityModel :raises ~corehttp.exceptions.HttpResponseError: @@ -123,6 +131,7 @@ async def get_model( _content = json.dumps(input, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_visibility_get_model_request( + query_prop=query_prop, content_type=content_type, content=_content, headers=_headers, @@ -161,12 +170,14 @@ async def get_model( @overload async def head_model( - self, input: _models.VisibilityModel, *, content_type: str = "application/json", **kwargs: Any + self, input: _models.VisibilityModel, *, query_prop: int, content_type: str = "application/json", **kwargs: Any ) -> None: """head_model. :param input: Required. :type input: ~headasbooleanfalse.models.VisibilityModel + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -176,11 +187,15 @@ async def head_model( """ @overload - async def head_model(self, input: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None: + async def head_model( + self, input: JSON, *, query_prop: int, content_type: str = "application/json", **kwargs: Any + ) -> None: """head_model. :param input: Required. :type input: JSON + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -190,11 +205,15 @@ async def head_model(self, input: JSON, *, content_type: str = "application/json """ @overload - async def head_model(self, input: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> None: + async def head_model( + self, input: IO[bytes], *, query_prop: int, content_type: str = "application/json", **kwargs: Any + ) -> None: """head_model. :param input: Required. :type input: IO[bytes] + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -203,11 +222,15 @@ async def head_model(self, input: IO[bytes], *, content_type: str = "application :raises ~corehttp.exceptions.HttpResponseError: """ - async def head_model(self, input: Union[_models.VisibilityModel, JSON, IO[bytes]], **kwargs: Any) -> None: + async def head_model( + self, input: Union[_models.VisibilityModel, JSON, IO[bytes]], *, query_prop: int, **kwargs: Any + ) -> None: """head_model. :param input: Is one of the following types: VisibilityModel, JSON, IO[bytes] Required. :type input: ~headasbooleanfalse.models.VisibilityModel or JSON or IO[bytes] + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :return: None :rtype: None :raises ~corehttp.exceptions.HttpResponseError: @@ -234,6 +257,7 @@ async def head_model(self, input: Union[_models.VisibilityModel, JSON, IO[bytes] _content = json.dumps(input, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_visibility_head_model_request( + query_prop=query_prop, content_type=content_type, content=_content, headers=_headers, diff --git a/packages/typespec-python/test/unbranded/generated/headasbooleanfalse/headasbooleanfalse/models/_models.py b/packages/typespec-python/test/unbranded/generated/headasbooleanfalse/headasbooleanfalse/models/_models.py index e9e648696dc..a302369b8a6 100644 --- a/packages/typespec-python/test/unbranded/generated/headasbooleanfalse/headasbooleanfalse/models/_models.py +++ b/packages/typespec-python/test/unbranded/generated/headasbooleanfalse/headasbooleanfalse/models/_models.py @@ -27,8 +27,6 @@ class VisibilityModel(_model_base.Model): :ivar read_prop: Required string, illustrating a readonly property. Required. :vartype read_prop: str - :ivar query_prop: Required int32, illustrating a query property. Required. - :vartype query_prop: int :ivar create_prop: Required string[], illustrating a create property. Required. :vartype create_prop: list[str] :ivar update_prop: Required int32[], illustrating a update property. Required. @@ -39,8 +37,6 @@ class VisibilityModel(_model_base.Model): read_prop: str = rest_field(name="readProp", visibility=["read"]) """Required string, illustrating a readonly property. Required.""" - query_prop: int = rest_field(name="queryProp", visibility=["query"]) - """Required int32, illustrating a query property. Required.""" create_prop: List[str] = rest_field(name="createProp", visibility=["create"]) """Required string[], illustrating a create property. Required.""" update_prop: List[int] = rest_field(name="updateProp", visibility=["update"]) @@ -52,7 +48,6 @@ class VisibilityModel(_model_base.Model): def __init__( self, *, - query_prop: int, create_prop: List[str], update_prop: List[int], delete_prop: bool, diff --git a/packages/typespec-python/test/unbranded/generated/headasbooleantrue/headasbooleantrue/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/headasbooleantrue/headasbooleantrue/_operations/_operations.py index dcbdf99bc58..4efb7eb20f3 100644 --- a/packages/typespec-python/test/unbranded/generated/headasbooleantrue/headasbooleantrue/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/headasbooleantrue/headasbooleantrue/_operations/_operations.py @@ -35,8 +35,9 @@ _SERIALIZER.client_side_validation = False -def build_visibility_get_model_request(**kwargs: Any) -> HttpRequest: +def build_visibility_get_model_request(*, query_prop: int, **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)) accept = _headers.pop("Accept", "application/json") @@ -44,26 +45,33 @@ def build_visibility_get_model_request(**kwargs: Any) -> HttpRequest: # Construct URL _url = "/type/model/visibility" + # Construct parameters + _params["queryProp"] = _SERIALIZER.query("query_prop", query_prop, "int") + # 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="GET", url=_url, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_visibility_head_model_request(**kwargs: Any) -> HttpRequest: +def build_visibility_head_model_request(*, query_prop: int, **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)) # Construct URL _url = "/type/model/visibility" + # Construct parameters + _params["queryProp"] = _SERIALIZER.query("query_prop", query_prop, "int") + # Construct headers if content_type is not None: _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - return HttpRequest(method="HEAD", url=_url, headers=_headers, **kwargs) + return HttpRequest(method="HEAD", url=_url, params=_params, headers=_headers, **kwargs) def build_visibility_put_model_request(**kwargs: Any) -> HttpRequest: @@ -143,12 +151,14 @@ class VisibilityClientOperationsMixin(VisibilityClientMixinABC): @overload def get_model( - self, input: _models.VisibilityModel, *, content_type: str = "application/json", **kwargs: Any + self, input: _models.VisibilityModel, *, query_prop: int, content_type: str = "application/json", **kwargs: Any ) -> _models.VisibilityModel: """get_model. :param input: Required. :type input: ~headasbooleantrue.models.VisibilityModel + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -159,12 +169,14 @@ def get_model( @overload def get_model( - self, input: JSON, *, content_type: str = "application/json", **kwargs: Any + self, input: JSON, *, query_prop: int, content_type: str = "application/json", **kwargs: Any ) -> _models.VisibilityModel: """get_model. :param input: Required. :type input: JSON + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -175,12 +187,14 @@ def get_model( @overload def get_model( - self, input: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + self, input: IO[bytes], *, query_prop: int, content_type: str = "application/json", **kwargs: Any ) -> _models.VisibilityModel: """get_model. :param input: Required. :type input: IO[bytes] + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -190,12 +204,14 @@ def get_model( """ def get_model( - self, input: Union[_models.VisibilityModel, JSON, IO[bytes]], **kwargs: Any + self, input: Union[_models.VisibilityModel, JSON, IO[bytes]], *, query_prop: int, **kwargs: Any ) -> _models.VisibilityModel: """get_model. :param input: Is one of the following types: VisibilityModel, JSON, IO[bytes] Required. :type input: ~headasbooleantrue.models.VisibilityModel or JSON or IO[bytes] + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :return: VisibilityModel. The VisibilityModel is compatible with MutableMapping :rtype: ~headasbooleantrue.models.VisibilityModel :raises ~corehttp.exceptions.HttpResponseError: @@ -222,6 +238,7 @@ def get_model( _content = json.dumps(input, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_visibility_get_model_request( + query_prop=query_prop, content_type=content_type, content=_content, headers=_headers, @@ -258,12 +275,14 @@ def get_model( @overload def head_model( - self, input: _models.VisibilityModel, *, content_type: str = "application/json", **kwargs: Any + self, input: _models.VisibilityModel, *, query_prop: int, content_type: str = "application/json", **kwargs: Any ) -> bool: """head_model. :param input: Required. :type input: ~headasbooleantrue.models.VisibilityModel + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -273,11 +292,15 @@ def head_model( """ @overload - def head_model(self, input: JSON, *, content_type: str = "application/json", **kwargs: Any) -> bool: + def head_model( + self, input: JSON, *, query_prop: int, content_type: str = "application/json", **kwargs: Any + ) -> bool: """head_model. :param input: Required. :type input: JSON + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -287,11 +310,15 @@ def head_model(self, input: JSON, *, content_type: str = "application/json", **k """ @overload - def head_model(self, input: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> bool: + def head_model( + self, input: IO[bytes], *, query_prop: int, content_type: str = "application/json", **kwargs: Any + ) -> bool: """head_model. :param input: Required. :type input: IO[bytes] + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -300,11 +327,15 @@ def head_model(self, input: IO[bytes], *, content_type: str = "application/json" :raises ~corehttp.exceptions.HttpResponseError: """ - def head_model(self, input: Union[_models.VisibilityModel, JSON, IO[bytes]], **kwargs: Any) -> bool: + def head_model( + self, input: Union[_models.VisibilityModel, JSON, IO[bytes]], *, query_prop: int, **kwargs: Any + ) -> bool: """head_model. :param input: Is one of the following types: VisibilityModel, JSON, IO[bytes] Required. :type input: ~headasbooleantrue.models.VisibilityModel or JSON or IO[bytes] + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :return: bool :rtype: bool :raises ~corehttp.exceptions.HttpResponseError: @@ -331,6 +362,7 @@ def head_model(self, input: Union[_models.VisibilityModel, JSON, IO[bytes]], **k _content = json.dumps(input, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_visibility_head_model_request( + query_prop=query_prop, content_type=content_type, content=_content, headers=_headers, diff --git a/packages/typespec-python/test/unbranded/generated/headasbooleantrue/headasbooleantrue/aio/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/headasbooleantrue/headasbooleantrue/aio/_operations/_operations.py index 23df09552be..af641cf3df7 100644 --- a/packages/typespec-python/test/unbranded/generated/headasbooleantrue/headasbooleantrue/aio/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/headasbooleantrue/headasbooleantrue/aio/_operations/_operations.py @@ -44,12 +44,14 @@ class VisibilityClientOperationsMixin(VisibilityClientMixinABC): @overload async def get_model( - self, input: _models.VisibilityModel, *, content_type: str = "application/json", **kwargs: Any + self, input: _models.VisibilityModel, *, query_prop: int, content_type: str = "application/json", **kwargs: Any ) -> _models.VisibilityModel: """get_model. :param input: Required. :type input: ~headasbooleantrue.models.VisibilityModel + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -60,12 +62,14 @@ async def get_model( @overload async def get_model( - self, input: JSON, *, content_type: str = "application/json", **kwargs: Any + self, input: JSON, *, query_prop: int, content_type: str = "application/json", **kwargs: Any ) -> _models.VisibilityModel: """get_model. :param input: Required. :type input: JSON + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -76,12 +80,14 @@ async def get_model( @overload async def get_model( - self, input: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + self, input: IO[bytes], *, query_prop: int, content_type: str = "application/json", **kwargs: Any ) -> _models.VisibilityModel: """get_model. :param input: Required. :type input: IO[bytes] + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -91,12 +97,14 @@ async def get_model( """ async def get_model( - self, input: Union[_models.VisibilityModel, JSON, IO[bytes]], **kwargs: Any + self, input: Union[_models.VisibilityModel, JSON, IO[bytes]], *, query_prop: int, **kwargs: Any ) -> _models.VisibilityModel: """get_model. :param input: Is one of the following types: VisibilityModel, JSON, IO[bytes] Required. :type input: ~headasbooleantrue.models.VisibilityModel or JSON or IO[bytes] + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :return: VisibilityModel. The VisibilityModel is compatible with MutableMapping :rtype: ~headasbooleantrue.models.VisibilityModel :raises ~corehttp.exceptions.HttpResponseError: @@ -123,6 +131,7 @@ async def get_model( _content = json.dumps(input, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_visibility_get_model_request( + query_prop=query_prop, content_type=content_type, content=_content, headers=_headers, @@ -161,12 +170,14 @@ async def get_model( @overload async def head_model( - self, input: _models.VisibilityModel, *, content_type: str = "application/json", **kwargs: Any + self, input: _models.VisibilityModel, *, query_prop: int, content_type: str = "application/json", **kwargs: Any ) -> bool: """head_model. :param input: Required. :type input: ~headasbooleantrue.models.VisibilityModel + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -176,11 +187,15 @@ async def head_model( """ @overload - async def head_model(self, input: JSON, *, content_type: str = "application/json", **kwargs: Any) -> bool: + async def head_model( + self, input: JSON, *, query_prop: int, content_type: str = "application/json", **kwargs: Any + ) -> bool: """head_model. :param input: Required. :type input: JSON + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -190,11 +205,15 @@ async def head_model(self, input: JSON, *, content_type: str = "application/json """ @overload - async def head_model(self, input: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> bool: + async def head_model( + self, input: IO[bytes], *, query_prop: int, content_type: str = "application/json", **kwargs: Any + ) -> bool: """head_model. :param input: Required. :type input: IO[bytes] + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -203,11 +222,15 @@ async def head_model(self, input: IO[bytes], *, content_type: str = "application :raises ~corehttp.exceptions.HttpResponseError: """ - async def head_model(self, input: Union[_models.VisibilityModel, JSON, IO[bytes]], **kwargs: Any) -> bool: + async def head_model( + self, input: Union[_models.VisibilityModel, JSON, IO[bytes]], *, query_prop: int, **kwargs: Any + ) -> bool: """head_model. :param input: Is one of the following types: VisibilityModel, JSON, IO[bytes] Required. :type input: ~headasbooleantrue.models.VisibilityModel or JSON or IO[bytes] + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :return: bool :rtype: bool :raises ~corehttp.exceptions.HttpResponseError: @@ -234,6 +257,7 @@ async def head_model(self, input: Union[_models.VisibilityModel, JSON, IO[bytes] _content = json.dumps(input, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_visibility_head_model_request( + query_prop=query_prop, content_type=content_type, content=_content, headers=_headers, diff --git a/packages/typespec-python/test/unbranded/generated/headasbooleantrue/headasbooleantrue/models/_models.py b/packages/typespec-python/test/unbranded/generated/headasbooleantrue/headasbooleantrue/models/_models.py index e9e648696dc..a302369b8a6 100644 --- a/packages/typespec-python/test/unbranded/generated/headasbooleantrue/headasbooleantrue/models/_models.py +++ b/packages/typespec-python/test/unbranded/generated/headasbooleantrue/headasbooleantrue/models/_models.py @@ -27,8 +27,6 @@ class VisibilityModel(_model_base.Model): :ivar read_prop: Required string, illustrating a readonly property. Required. :vartype read_prop: str - :ivar query_prop: Required int32, illustrating a query property. Required. - :vartype query_prop: int :ivar create_prop: Required string[], illustrating a create property. Required. :vartype create_prop: list[str] :ivar update_prop: Required int32[], illustrating a update property. Required. @@ -39,8 +37,6 @@ class VisibilityModel(_model_base.Model): read_prop: str = rest_field(name="readProp", visibility=["read"]) """Required string, illustrating a readonly property. Required.""" - query_prop: int = rest_field(name="queryProp", visibility=["query"]) - """Required int32, illustrating a query property. Required.""" create_prop: List[str] = rest_field(name="createProp", visibility=["create"]) """Required string[], illustrating a create property. Required.""" update_prop: List[int] = rest_field(name="updateProp", visibility=["update"]) @@ -52,7 +48,6 @@ class VisibilityModel(_model_base.Model): def __init__( self, *, - query_prop: int, create_prop: List[str], update_prop: List[int], delete_prop: bool, diff --git a/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/formdata/aio/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/formdata/aio/operations/_operations.py index 89cdf7d0005..117493833d6 100644 --- a/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/formdata/aio/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/formdata/aio/operations/_operations.py @@ -14,9 +14,10 @@ from corehttp.runtime import AsyncPipelineClient from corehttp.runtime.pipeline import PipelineResponse +from ... import models as _models2 from .... import _model_base, models as _models3 from ...._serialization import Deserializer, Serializer -from ...._vendor import FileType, prepare_multipart_form_data +from ...._vendor import prepare_multipart_form_data from ....aio._configuration import MultiPartClientConfiguration from ...httpparts.aio.operations._operations import FormDataHttpPartsOperations from ...operations._operations import ( @@ -34,7 +35,6 @@ else: from typing import MutableMapping # type: ignore JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object -_Unset: Any = object() T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -493,11 +493,11 @@ async def check_file_name_and_content_type( return cls(pipeline_response, None, {}) # type: ignore @overload - async def anonymous_model(self, *, profile_image: FileType, **kwargs: Any) -> None: + async def anonymous_model(self, body: _models2.AnonymousModelRequest, **kwargs: Any) -> None: """Test content-type: multipart/form-data. - :keyword profile_image: Required. - :paramtype profile_image: ~payload.multipart._vendor.FileType + :param body: Required. + :type body: ~payload.multipart.models.AnonymousModelRequest :return: None :rtype: None :raises ~corehttp.exceptions.HttpResponseError: @@ -514,13 +514,11 @@ async def anonymous_model(self, body: JSON, **kwargs: Any) -> None: :raises ~corehttp.exceptions.HttpResponseError: """ - async def anonymous_model(self, body: JSON = _Unset, *, profile_image: FileType = _Unset, **kwargs: Any) -> None: + async def anonymous_model(self, body: Union[_models2.AnonymousModelRequest, JSON], **kwargs: Any) -> None: """Test content-type: multipart/form-data. - :param body: Is one of the following types: JSON Required. - :type body: JSON - :keyword profile_image: Required. - :paramtype profile_image: ~payload.multipart._vendor.FileType + :param body: Is either a AnonymousModelRequest type or a JSON type. Required. + :type body: ~payload.multipart.models.AnonymousModelRequest or JSON :return: None :rtype: None :raises ~corehttp.exceptions.HttpResponseError: @@ -538,11 +536,6 @@ async def anonymous_model(self, body: JSON = _Unset, *, profile_image: FileType cls: ClsType[None] = kwargs.pop("cls", None) - if body is _Unset: - if profile_image is _Unset: - raise TypeError("missing required argument: profile_image") - body = {"profileImage": profile_image} - body = {k: v for k, v in body.items() if v is not None} _body = body.as_dict() if isinstance(body, _model_base.Model) else body _file_fields: List[str] = ["profileImage"] _data_fields: List[str] = [] diff --git a/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/formdata/models/__init__.py b/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/formdata/models/__init__.py new file mode 100644 index 00000000000..c5f6fcb7501 --- /dev/null +++ b/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/formdata/models/__init__.py @@ -0,0 +1,21 @@ +# coding=utf-8 +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + + +from ._models import ( # type: ignore + AnonymousModelRequest, +) +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "AnonymousModelRequest", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/formdata/models/_models.py b/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/formdata/models/_models.py new file mode 100644 index 00000000000..216cf5fe7e0 --- /dev/null +++ b/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/formdata/models/_models.py @@ -0,0 +1,38 @@ +# coding=utf-8 +# pylint: disable=useless-super-delegation + +from typing import Any, Mapping, overload + +from ... import _model_base +from ..._model_base import rest_field +from ..._vendor import FileType + + +class AnonymousModelRequest(_model_base.Model): + """AnonymousModelRequest. + + :ivar profile_image: Required. + :vartype profile_image: ~payload.multipart._vendor.FileType + """ + + profile_image: FileType = rest_field( + name="profileImage", visibility=["read", "create", "update", "delete", "query"], is_multipart_file_input=True + ) + """Required.""" + + @overload + def __init__( + self, + *, + profile_image: FileType, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) diff --git a/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/formdata/models/_patch.py b/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/formdata/models/_patch.py new file mode 100644 index 00000000000..894b28a174c --- /dev/null +++ b/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/formdata/models/_patch.py @@ -0,0 +1,18 @@ +# coding=utf-8 + +"""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/payload-multipart/payload/multipart/formdata/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/formdata/operations/_operations.py index 5e29ef3b654..87b3ddb29d9 100644 --- a/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/formdata/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/payload-multipart/payload/multipart/formdata/operations/_operations.py @@ -15,10 +15,11 @@ from corehttp.runtime.pipeline import PipelineResponse from corehttp.utils import case_insensitive_dict +from .. import models as _models1 from ... import _model_base, models as _models2 from ..._configuration import MultiPartClientConfiguration from ..._serialization import Deserializer, Serializer -from ..._vendor import FileType, prepare_multipart_form_data +from ..._vendor import prepare_multipart_form_data from ..httpparts.operations._operations import FormDataHttpPartsOperations if sys.version_info >= (3, 9): @@ -26,7 +27,6 @@ else: from typing import MutableMapping # type: ignore JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object -_Unset: Any = object() T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -563,11 +563,11 @@ def check_file_name_and_content_type( # pylint: disable=inconsistent-return-sta return cls(pipeline_response, None, {}) # type: ignore @overload - def anonymous_model(self, *, profile_image: FileType, **kwargs: Any) -> None: + def anonymous_model(self, body: _models1.AnonymousModelRequest, **kwargs: Any) -> None: """Test content-type: multipart/form-data. - :keyword profile_image: Required. - :paramtype profile_image: ~payload.multipart._vendor.FileType + :param body: Required. + :type body: ~payload.multipart.models.AnonymousModelRequest :return: None :rtype: None :raises ~corehttp.exceptions.HttpResponseError: @@ -585,14 +585,12 @@ def anonymous_model(self, body: JSON, **kwargs: Any) -> None: """ def anonymous_model( # pylint: disable=inconsistent-return-statements - self, body: JSON = _Unset, *, profile_image: FileType = _Unset, **kwargs: Any + self, body: Union[_models1.AnonymousModelRequest, JSON], **kwargs: Any ) -> None: """Test content-type: multipart/form-data. - :param body: Is one of the following types: JSON Required. - :type body: JSON - :keyword profile_image: Required. - :paramtype profile_image: ~payload.multipart._vendor.FileType + :param body: Is either a AnonymousModelRequest type or a JSON type. Required. + :type body: ~payload.multipart.models.AnonymousModelRequest or JSON :return: None :rtype: None :raises ~corehttp.exceptions.HttpResponseError: @@ -610,11 +608,6 @@ def anonymous_model( # pylint: disable=inconsistent-return-statements cls: ClsType[None] = kwargs.pop("cls", None) - if body is _Unset: - if profile_image is _Unset: - raise TypeError("missing required argument: profile_image") - body = {"profileImage": profile_image} - body = {k: v for k, v in body.items() if v is not None} _body = body.as_dict() if isinstance(body, _model_base.Model) else body _file_fields: List[str] = ["profileImage"] _data_fields: List[str] = [] diff --git a/packages/typespec-python/test/unbranded/generated/server-path-multiple/server/path/multiple/_client.py b/packages/typespec-python/test/unbranded/generated/server-path-multiple/server/path/multiple/_client.py index 64f280c560c..48b7d02c67c 100644 --- a/packages/typespec-python/test/unbranded/generated/server-path-multiple/server/path/multiple/_client.py +++ b/packages/typespec-python/test/unbranded/generated/server-path-multiple/server/path/multiple/_client.py @@ -65,7 +65,7 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "apiVersion": self._serialize.url( "self._config.api_version", self._config.api_version, "str", skip_quote=True ), diff --git a/packages/typespec-python/test/unbranded/generated/server-path-multiple/server/path/multiple/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/server-path-multiple/server/path/multiple/_operations/_operations.py index f8f700de3e5..3ddef635a0e 100644 --- a/packages/typespec-python/test/unbranded/generated/server-path-multiple/server/path/multiple/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/server-path-multiple/server/path/multiple/_operations/_operations.py @@ -75,7 +75,7 @@ def no_operation_params(self, **kwargs: Any) -> None: # pylint: disable=inconsi params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "apiVersion": self._serialize.url( "self._config.api_version", self._config.api_version, "str", skip_quote=True ), @@ -124,7 +124,7 @@ def with_operation_path_param( # pylint: disable=inconsistent-return-statements params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "apiVersion": self._serialize.url( "self._config.api_version", self._config.api_version, "str", skip_quote=True ), diff --git a/packages/typespec-python/test/unbranded/generated/server-path-multiple/server/path/multiple/aio/_client.py b/packages/typespec-python/test/unbranded/generated/server-path-multiple/server/path/multiple/aio/_client.py index 6b693d4c97f..fc26d708289 100644 --- a/packages/typespec-python/test/unbranded/generated/server-path-multiple/server/path/multiple/aio/_client.py +++ b/packages/typespec-python/test/unbranded/generated/server-path-multiple/server/path/multiple/aio/_client.py @@ -67,7 +67,7 @@ def send_request( request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "apiVersion": self._serialize.url( "self._config.api_version", self._config.api_version, "str", skip_quote=True ), diff --git a/packages/typespec-python/test/unbranded/generated/server-path-multiple/server/path/multiple/aio/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/server-path-multiple/server/path/multiple/aio/_operations/_operations.py index 79fde84a94e..76d221cef2d 100644 --- a/packages/typespec-python/test/unbranded/generated/server-path-multiple/server/path/multiple/aio/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/server-path-multiple/server/path/multiple/aio/_operations/_operations.py @@ -54,7 +54,7 @@ async def no_operation_params(self, **kwargs: Any) -> None: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "apiVersion": self._serialize.url( "self._config.api_version", self._config.api_version, "str", skip_quote=True ), @@ -103,7 +103,7 @@ async def with_operation_path_param(self, keyword: str, **kwargs: Any) -> None: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "apiVersion": self._serialize.url( "self._config.api_version", self._config.api_version, "str", skip_quote=True ), diff --git a/packages/typespec-python/test/unbranded/generated/server-path-single/server/path/single/_client.py b/packages/typespec-python/test/unbranded/generated/server-path-single/server/path/single/_client.py index 005113b78a7..9d94ede45c4 100644 --- a/packages/typespec-python/test/unbranded/generated/server-path-single/server/path/single/_client.py +++ b/packages/typespec-python/test/unbranded/generated/server-path-single/server/path/single/_client.py @@ -62,7 +62,7 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), } request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) diff --git a/packages/typespec-python/test/unbranded/generated/server-path-single/server/path/single/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/server-path-single/server/path/single/_operations/_operations.py index ad3885fe1bb..eaf01cd840a 100644 --- a/packages/typespec-python/test/unbranded/generated/server-path-single/server/path/single/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/server-path-single/server/path/single/_operations/_operations.py @@ -61,7 +61,7 @@ def my_op(self, **kwargs: Any) -> bool: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) diff --git a/packages/typespec-python/test/unbranded/generated/server-path-single/server/path/single/aio/_client.py b/packages/typespec-python/test/unbranded/generated/server-path-single/server/path/single/aio/_client.py index ce92ede3511..cf39dec88d8 100644 --- a/packages/typespec-python/test/unbranded/generated/server-path-single/server/path/single/aio/_client.py +++ b/packages/typespec-python/test/unbranded/generated/server-path-single/server/path/single/aio/_client.py @@ -64,7 +64,7 @@ def send_request( request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), } request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) diff --git a/packages/typespec-python/test/unbranded/generated/server-path-single/server/path/single/aio/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/server-path-single/server/path/single/aio/_operations/_operations.py index afcce6aa2aa..c24af80cbaa 100644 --- a/packages/typespec-python/test/unbranded/generated/server-path-single/server/path/single/aio/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/server-path-single/server/path/single/aio/_operations/_operations.py @@ -51,7 +51,7 @@ async def my_op(self, **kwargs: Any) -> bool: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) diff --git a/packages/typespec-python/test/unbranded/generated/server-versions-not-versioned/server/versions/notversioned/_client.py b/packages/typespec-python/test/unbranded/generated/server-versions-not-versioned/server/versions/notversioned/_client.py index 23b47be24cc..3fd3619586f 100644 --- a/packages/typespec-python/test/unbranded/generated/server-versions-not-versioned/server/versions/notversioned/_client.py +++ b/packages/typespec-python/test/unbranded/generated/server-versions-not-versioned/server/versions/notversioned/_client.py @@ -62,7 +62,7 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), } request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) diff --git a/packages/typespec-python/test/unbranded/generated/server-versions-not-versioned/server/versions/notversioned/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/server-versions-not-versioned/server/versions/notversioned/_operations/_operations.py index ba5e916bedb..07307a32fca 100644 --- a/packages/typespec-python/test/unbranded/generated/server-versions-not-versioned/server/versions/notversioned/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/server-versions-not-versioned/server/versions/notversioned/_operations/_operations.py @@ -90,7 +90,7 @@ def without_api_version(self, **kwargs: Any) -> bool: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -135,7 +135,7 @@ def with_query_api_version(self, *, api_version: str, **kwargs: Any) -> bool: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -180,7 +180,7 @@ def with_path_api_version(self, api_version: str, **kwargs: Any) -> bool: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) diff --git a/packages/typespec-python/test/unbranded/generated/server-versions-not-versioned/server/versions/notversioned/aio/_client.py b/packages/typespec-python/test/unbranded/generated/server-versions-not-versioned/server/versions/notversioned/aio/_client.py index efde6d74c69..df0f86b36d6 100644 --- a/packages/typespec-python/test/unbranded/generated/server-versions-not-versioned/server/versions/notversioned/aio/_client.py +++ b/packages/typespec-python/test/unbranded/generated/server-versions-not-versioned/server/versions/notversioned/aio/_client.py @@ -64,7 +64,7 @@ def send_request( request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), } request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) diff --git a/packages/typespec-python/test/unbranded/generated/server-versions-not-versioned/server/versions/notversioned/aio/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/server-versions-not-versioned/server/versions/notversioned/aio/_operations/_operations.py index 87cbc24df0c..56164aee17d 100644 --- a/packages/typespec-python/test/unbranded/generated/server-versions-not-versioned/server/versions/notversioned/aio/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/server-versions-not-versioned/server/versions/notversioned/aio/_operations/_operations.py @@ -55,7 +55,7 @@ async def without_api_version(self, **kwargs: Any) -> bool: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -102,7 +102,7 @@ async def with_query_api_version(self, *, api_version: str, **kwargs: Any) -> bo params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -149,7 +149,7 @@ async def with_path_api_version(self, api_version: str, **kwargs: Any) -> bool: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) diff --git a/packages/typespec-python/test/unbranded/generated/server-versions-versioned/server/versions/versioned/_client.py b/packages/typespec-python/test/unbranded/generated/server-versions-versioned/server/versions/versioned/_client.py index 88244d26e50..a1560cadfe2 100644 --- a/packages/typespec-python/test/unbranded/generated/server-versions-versioned/server/versions/versioned/_client.py +++ b/packages/typespec-python/test/unbranded/generated/server-versions-versioned/server/versions/versioned/_client.py @@ -65,7 +65,7 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), } request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) diff --git a/packages/typespec-python/test/unbranded/generated/server-versions-versioned/server/versions/versioned/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/server-versions-versioned/server/versions/versioned/_operations/_operations.py index 3256fd7526c..778e6e8714f 100644 --- a/packages/typespec-python/test/unbranded/generated/server-versions-versioned/server/versions/versioned/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/server-versions-versioned/server/versions/versioned/_operations/_operations.py @@ -101,7 +101,7 @@ def without_api_version(self, **kwargs: Any) -> bool: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -144,7 +144,7 @@ def with_query_api_version(self, **kwargs: Any) -> bool: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -187,7 +187,7 @@ def with_path_api_version(self, **kwargs: Any) -> bool: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -230,7 +230,7 @@ def with_query_old_api_version(self, **kwargs: Any) -> bool: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) diff --git a/packages/typespec-python/test/unbranded/generated/server-versions-versioned/server/versions/versioned/aio/_client.py b/packages/typespec-python/test/unbranded/generated/server-versions-versioned/server/versions/versioned/aio/_client.py index 22217dca03c..636a41a73b3 100644 --- a/packages/typespec-python/test/unbranded/generated/server-versions-versioned/server/versions/versioned/aio/_client.py +++ b/packages/typespec-python/test/unbranded/generated/server-versions-versioned/server/versions/versioned/aio/_client.py @@ -67,7 +67,7 @@ def send_request( request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), } request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) diff --git a/packages/typespec-python/test/unbranded/generated/server-versions-versioned/server/versions/versioned/aio/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/server-versions-versioned/server/versions/versioned/aio/_operations/_operations.py index 5af20a690df..d655cce3d6c 100644 --- a/packages/typespec-python/test/unbranded/generated/server-versions-versioned/server/versions/versioned/aio/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/server-versions-versioned/server/versions/versioned/aio/_operations/_operations.py @@ -56,7 +56,7 @@ async def without_api_version(self, **kwargs: Any) -> bool: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -101,7 +101,7 @@ async def with_query_api_version(self, **kwargs: Any) -> bool: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -146,7 +146,7 @@ async def with_path_api_version(self, **kwargs: Any) -> bool: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -191,7 +191,7 @@ async def with_query_old_api_version(self, **kwargs: Any) -> bool: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) diff --git a/packages/typespec-python/test/unbranded/generated/typetest-model-visibility/typetest/model/visibility/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/typetest-model-visibility/typetest/model/visibility/_operations/_operations.py index b9543235879..f46baf56ff0 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-model-visibility/typetest/model/visibility/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-model-visibility/typetest/model/visibility/_operations/_operations.py @@ -35,8 +35,9 @@ _SERIALIZER.client_side_validation = False -def build_visibility_get_model_request(**kwargs: Any) -> HttpRequest: +def build_visibility_get_model_request(*, query_prop: int, **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)) accept = _headers.pop("Accept", "application/json") @@ -44,26 +45,33 @@ def build_visibility_get_model_request(**kwargs: Any) -> HttpRequest: # Construct URL _url = "/type/model/visibility" + # Construct parameters + _params["queryProp"] = _SERIALIZER.query("query_prop", query_prop, "int") + # 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="GET", url=_url, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_visibility_head_model_request(**kwargs: Any) -> HttpRequest: +def build_visibility_head_model_request(*, query_prop: int, **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)) # Construct URL _url = "/type/model/visibility" + # Construct parameters + _params["queryProp"] = _SERIALIZER.query("query_prop", query_prop, "int") + # Construct headers if content_type is not None: _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - return HttpRequest(method="HEAD", url=_url, headers=_headers, **kwargs) + return HttpRequest(method="HEAD", url=_url, params=_params, headers=_headers, **kwargs) def build_visibility_put_model_request(**kwargs: Any) -> HttpRequest: @@ -143,12 +151,14 @@ class VisibilityClientOperationsMixin(VisibilityClientMixinABC): @overload def get_model( - self, input: _models.VisibilityModel, *, content_type: str = "application/json", **kwargs: Any + self, input: _models.VisibilityModel, *, query_prop: int, content_type: str = "application/json", **kwargs: Any ) -> _models.VisibilityModel: """get_model. :param input: Required. :type input: ~typetest.model.visibility.models.VisibilityModel + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -159,12 +169,14 @@ def get_model( @overload def get_model( - self, input: JSON, *, content_type: str = "application/json", **kwargs: Any + self, input: JSON, *, query_prop: int, content_type: str = "application/json", **kwargs: Any ) -> _models.VisibilityModel: """get_model. :param input: Required. :type input: JSON + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -175,12 +187,14 @@ def get_model( @overload def get_model( - self, input: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + self, input: IO[bytes], *, query_prop: int, content_type: str = "application/json", **kwargs: Any ) -> _models.VisibilityModel: """get_model. :param input: Required. :type input: IO[bytes] + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -190,12 +204,14 @@ def get_model( """ def get_model( - self, input: Union[_models.VisibilityModel, JSON, IO[bytes]], **kwargs: Any + self, input: Union[_models.VisibilityModel, JSON, IO[bytes]], *, query_prop: int, **kwargs: Any ) -> _models.VisibilityModel: """get_model. :param input: Is one of the following types: VisibilityModel, JSON, IO[bytes] Required. :type input: ~typetest.model.visibility.models.VisibilityModel or JSON or IO[bytes] + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :return: VisibilityModel. The VisibilityModel is compatible with MutableMapping :rtype: ~typetest.model.visibility.models.VisibilityModel :raises ~corehttp.exceptions.HttpResponseError: @@ -222,6 +238,7 @@ def get_model( _content = json.dumps(input, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_visibility_get_model_request( + query_prop=query_prop, content_type=content_type, content=_content, headers=_headers, @@ -258,12 +275,14 @@ def get_model( @overload def head_model( - self, input: _models.VisibilityModel, *, content_type: str = "application/json", **kwargs: Any + self, input: _models.VisibilityModel, *, query_prop: int, content_type: str = "application/json", **kwargs: Any ) -> bool: """head_model. :param input: Required. :type input: ~typetest.model.visibility.models.VisibilityModel + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -273,11 +292,15 @@ def head_model( """ @overload - def head_model(self, input: JSON, *, content_type: str = "application/json", **kwargs: Any) -> bool: + def head_model( + self, input: JSON, *, query_prop: int, content_type: str = "application/json", **kwargs: Any + ) -> bool: """head_model. :param input: Required. :type input: JSON + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -287,11 +310,15 @@ def head_model(self, input: JSON, *, content_type: str = "application/json", **k """ @overload - def head_model(self, input: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> bool: + def head_model( + self, input: IO[bytes], *, query_prop: int, content_type: str = "application/json", **kwargs: Any + ) -> bool: """head_model. :param input: Required. :type input: IO[bytes] + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -300,11 +327,15 @@ def head_model(self, input: IO[bytes], *, content_type: str = "application/json" :raises ~corehttp.exceptions.HttpResponseError: """ - def head_model(self, input: Union[_models.VisibilityModel, JSON, IO[bytes]], **kwargs: Any) -> bool: + def head_model( + self, input: Union[_models.VisibilityModel, JSON, IO[bytes]], *, query_prop: int, **kwargs: Any + ) -> bool: """head_model. :param input: Is one of the following types: VisibilityModel, JSON, IO[bytes] Required. :type input: ~typetest.model.visibility.models.VisibilityModel or JSON or IO[bytes] + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :return: bool :rtype: bool :raises ~corehttp.exceptions.HttpResponseError: @@ -331,6 +362,7 @@ def head_model(self, input: Union[_models.VisibilityModel, JSON, IO[bytes]], **k _content = json.dumps(input, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_visibility_head_model_request( + query_prop=query_prop, content_type=content_type, content=_content, headers=_headers, diff --git a/packages/typespec-python/test/unbranded/generated/typetest-model-visibility/typetest/model/visibility/aio/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/typetest-model-visibility/typetest/model/visibility/aio/_operations/_operations.py index cdedd3cf7b6..614fcb60635 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-model-visibility/typetest/model/visibility/aio/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-model-visibility/typetest/model/visibility/aio/_operations/_operations.py @@ -44,12 +44,14 @@ class VisibilityClientOperationsMixin(VisibilityClientMixinABC): @overload async def get_model( - self, input: _models.VisibilityModel, *, content_type: str = "application/json", **kwargs: Any + self, input: _models.VisibilityModel, *, query_prop: int, content_type: str = "application/json", **kwargs: Any ) -> _models.VisibilityModel: """get_model. :param input: Required. :type input: ~typetest.model.visibility.models.VisibilityModel + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -60,12 +62,14 @@ async def get_model( @overload async def get_model( - self, input: JSON, *, content_type: str = "application/json", **kwargs: Any + self, input: JSON, *, query_prop: int, content_type: str = "application/json", **kwargs: Any ) -> _models.VisibilityModel: """get_model. :param input: Required. :type input: JSON + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -76,12 +80,14 @@ async def get_model( @overload async def get_model( - self, input: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + self, input: IO[bytes], *, query_prop: int, content_type: str = "application/json", **kwargs: Any ) -> _models.VisibilityModel: """get_model. :param input: Required. :type input: IO[bytes] + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -91,12 +97,14 @@ async def get_model( """ async def get_model( - self, input: Union[_models.VisibilityModel, JSON, IO[bytes]], **kwargs: Any + self, input: Union[_models.VisibilityModel, JSON, IO[bytes]], *, query_prop: int, **kwargs: Any ) -> _models.VisibilityModel: """get_model. :param input: Is one of the following types: VisibilityModel, JSON, IO[bytes] Required. :type input: ~typetest.model.visibility.models.VisibilityModel or JSON or IO[bytes] + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :return: VisibilityModel. The VisibilityModel is compatible with MutableMapping :rtype: ~typetest.model.visibility.models.VisibilityModel :raises ~corehttp.exceptions.HttpResponseError: @@ -123,6 +131,7 @@ async def get_model( _content = json.dumps(input, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_visibility_get_model_request( + query_prop=query_prop, content_type=content_type, content=_content, headers=_headers, @@ -161,12 +170,14 @@ async def get_model( @overload async def head_model( - self, input: _models.VisibilityModel, *, content_type: str = "application/json", **kwargs: Any + self, input: _models.VisibilityModel, *, query_prop: int, content_type: str = "application/json", **kwargs: Any ) -> bool: """head_model. :param input: Required. :type input: ~typetest.model.visibility.models.VisibilityModel + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -176,11 +187,15 @@ async def head_model( """ @overload - async def head_model(self, input: JSON, *, content_type: str = "application/json", **kwargs: Any) -> bool: + async def head_model( + self, input: JSON, *, query_prop: int, content_type: str = "application/json", **kwargs: Any + ) -> bool: """head_model. :param input: Required. :type input: JSON + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str @@ -190,11 +205,15 @@ async def head_model(self, input: JSON, *, content_type: str = "application/json """ @overload - async def head_model(self, input: IO[bytes], *, content_type: str = "application/json", **kwargs: Any) -> bool: + async def head_model( + self, input: IO[bytes], *, query_prop: int, content_type: str = "application/json", **kwargs: Any + ) -> bool: """head_model. :param input: Required. :type input: IO[bytes] + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str @@ -203,11 +222,15 @@ async def head_model(self, input: IO[bytes], *, content_type: str = "application :raises ~corehttp.exceptions.HttpResponseError: """ - async def head_model(self, input: Union[_models.VisibilityModel, JSON, IO[bytes]], **kwargs: Any) -> bool: + async def head_model( + self, input: Union[_models.VisibilityModel, JSON, IO[bytes]], *, query_prop: int, **kwargs: Any + ) -> bool: """head_model. :param input: Is one of the following types: VisibilityModel, JSON, IO[bytes] Required. :type input: ~typetest.model.visibility.models.VisibilityModel or JSON or IO[bytes] + :keyword query_prop: Required int32, illustrating a query property. Required. + :paramtype query_prop: int :return: bool :rtype: bool :raises ~corehttp.exceptions.HttpResponseError: @@ -234,6 +257,7 @@ async def head_model(self, input: Union[_models.VisibilityModel, JSON, IO[bytes] _content = json.dumps(input, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_visibility_head_model_request( + query_prop=query_prop, content_type=content_type, content=_content, headers=_headers, diff --git a/packages/typespec-python/test/unbranded/generated/typetest-model-visibility/typetest/model/visibility/models/_models.py b/packages/typespec-python/test/unbranded/generated/typetest-model-visibility/typetest/model/visibility/models/_models.py index e9e648696dc..a302369b8a6 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-model-visibility/typetest/model/visibility/models/_models.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-model-visibility/typetest/model/visibility/models/_models.py @@ -27,8 +27,6 @@ class VisibilityModel(_model_base.Model): :ivar read_prop: Required string, illustrating a readonly property. Required. :vartype read_prop: str - :ivar query_prop: Required int32, illustrating a query property. Required. - :vartype query_prop: int :ivar create_prop: Required string[], illustrating a create property. Required. :vartype create_prop: list[str] :ivar update_prop: Required int32[], illustrating a update property. Required. @@ -39,8 +37,6 @@ class VisibilityModel(_model_base.Model): read_prop: str = rest_field(name="readProp", visibility=["read"]) """Required string, illustrating a readonly property. Required.""" - query_prop: int = rest_field(name="queryProp", visibility=["query"]) - """Required int32, illustrating a query property. Required.""" create_prop: List[str] = rest_field(name="createProp", visibility=["create"]) """Required string[], illustrating a create property. Required.""" update_prop: List[int] = rest_field(name="updateProp", visibility=["update"]) @@ -52,7 +48,6 @@ class VisibilityModel(_model_base.Model): def __init__( self, *, - query_prop: int, create_prop: List[str], update_prop: List[int], delete_prop: bool, diff --git a/packages/typespec-python/test/unbranded/generated/versioning-added/versioning/added/_client.py b/packages/typespec-python/test/unbranded/generated/versioning-added/versioning/added/_client.py index 63f29eb9d9a..c5e890ffac7 100644 --- a/packages/typespec-python/test/unbranded/generated/versioning-added/versioning/added/_client.py +++ b/packages/typespec-python/test/unbranded/generated/versioning-added/versioning/added/_client.py @@ -69,7 +69,7 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), } diff --git a/packages/typespec-python/test/unbranded/generated/versioning-added/versioning/added/aio/_client.py b/packages/typespec-python/test/unbranded/generated/versioning-added/versioning/added/aio/_client.py index 7125566bfb1..5762260c5a0 100644 --- a/packages/typespec-python/test/unbranded/generated/versioning-added/versioning/added/aio/_client.py +++ b/packages/typespec-python/test/unbranded/generated/versioning-added/versioning/added/aio/_client.py @@ -71,7 +71,7 @@ def send_request( request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), } diff --git a/packages/typespec-python/test/unbranded/generated/versioning-added/versioning/added/aio/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/versioning-added/versioning/added/aio/operations/_operations.py index 89d0ba3c34f..5a048fc4675 100644 --- a/packages/typespec-python/test/unbranded/generated/versioning-added/versioning/added/aio/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/versioning-added/versioning/added/aio/operations/_operations.py @@ -146,7 +146,7 @@ async def v2_in_interface(self, body: Union[_models.ModelV2, JSON, IO[bytes]], * params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -277,7 +277,7 @@ async def v1( params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -393,7 +393,7 @@ async def v2(self, body: Union[_models.ModelV2, JSON, IO[bytes]], **kwargs: Any) params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) diff --git a/packages/typespec-python/test/unbranded/generated/versioning-added/versioning/added/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/versioning-added/versioning/added/operations/_operations.py index 7c6de939c8d..9904cb16c2d 100644 --- a/packages/typespec-python/test/unbranded/generated/versioning-added/versioning/added/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/versioning-added/versioning/added/operations/_operations.py @@ -194,7 +194,7 @@ def v2_in_interface(self, body: Union[_models.ModelV2, JSON, IO[bytes]], **kwarg params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -323,7 +323,7 @@ def v1(self, body: Union[_models.ModelV1, JSON, IO[bytes]], *, header_v2: str, * params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -435,7 +435,7 @@ def v2(self, body: Union[_models.ModelV2, JSON, IO[bytes]], **kwargs: Any) -> _m params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) diff --git a/packages/typespec-python/test/unbranded/generated/versioning-madeoptional/versioning/madeoptional/_client.py b/packages/typespec-python/test/unbranded/generated/versioning-madeoptional/versioning/madeoptional/_client.py index f42e026f444..8604607aded 100644 --- a/packages/typespec-python/test/unbranded/generated/versioning-madeoptional/versioning/madeoptional/_client.py +++ b/packages/typespec-python/test/unbranded/generated/versioning-madeoptional/versioning/madeoptional/_client.py @@ -66,7 +66,7 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), } diff --git a/packages/typespec-python/test/unbranded/generated/versioning-madeoptional/versioning/madeoptional/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/versioning-madeoptional/versioning/madeoptional/_operations/_operations.py index a2e846371d7..7e05293e716 100644 --- a/packages/typespec-python/test/unbranded/generated/versioning-madeoptional/versioning/madeoptional/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/versioning-madeoptional/versioning/madeoptional/_operations/_operations.py @@ -160,7 +160,7 @@ def test( params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) diff --git a/packages/typespec-python/test/unbranded/generated/versioning-madeoptional/versioning/madeoptional/aio/_client.py b/packages/typespec-python/test/unbranded/generated/versioning-madeoptional/versioning/madeoptional/aio/_client.py index 35b6e4d616a..19b352ffae9 100644 --- a/packages/typespec-python/test/unbranded/generated/versioning-madeoptional/versioning/madeoptional/aio/_client.py +++ b/packages/typespec-python/test/unbranded/generated/versioning-madeoptional/versioning/madeoptional/aio/_client.py @@ -68,7 +68,7 @@ def send_request( request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), } diff --git a/packages/typespec-python/test/unbranded/generated/versioning-madeoptional/versioning/madeoptional/aio/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/versioning-madeoptional/versioning/madeoptional/aio/_operations/_operations.py index 5dc99a7e4e7..8b9d46ffe13 100644 --- a/packages/typespec-python/test/unbranded/generated/versioning-madeoptional/versioning/madeoptional/aio/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/versioning-madeoptional/versioning/madeoptional/aio/_operations/_operations.py @@ -135,7 +135,7 @@ async def test( params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) diff --git a/packages/typespec-python/test/unbranded/generated/versioning-removed/versioning/removed/_client.py b/packages/typespec-python/test/unbranded/generated/versioning-removed/versioning/removed/_client.py index 2b57008f03b..6cc6e1b3920 100644 --- a/packages/typespec-python/test/unbranded/generated/versioning-removed/versioning/removed/_client.py +++ b/packages/typespec-python/test/unbranded/generated/versioning-removed/versioning/removed/_client.py @@ -66,7 +66,7 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), } diff --git a/packages/typespec-python/test/unbranded/generated/versioning-removed/versioning/removed/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/versioning-removed/versioning/removed/_operations/_operations.py index 1f09bc1fc1c..a2d5ea67c5a 100644 --- a/packages/typespec-python/test/unbranded/generated/versioning-removed/versioning/removed/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/versioning-removed/versioning/removed/_operations/_operations.py @@ -150,7 +150,7 @@ def v2(self, body: Union[_models.ModelV2, JSON, IO[bytes]], **kwargs: Any) -> _m params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -264,7 +264,7 @@ def model_v3(self, body: Union[_models.ModelV3, JSON, IO[bytes]], **kwargs: Any) params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) diff --git a/packages/typespec-python/test/unbranded/generated/versioning-removed/versioning/removed/aio/_client.py b/packages/typespec-python/test/unbranded/generated/versioning-removed/versioning/removed/aio/_client.py index d88798bb711..deae9255467 100644 --- a/packages/typespec-python/test/unbranded/generated/versioning-removed/versioning/removed/aio/_client.py +++ b/packages/typespec-python/test/unbranded/generated/versioning-removed/versioning/removed/aio/_client.py @@ -68,7 +68,7 @@ def send_request( request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), } diff --git a/packages/typespec-python/test/unbranded/generated/versioning-removed/versioning/removed/aio/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/versioning-removed/versioning/removed/aio/_operations/_operations.py index 4a7c0c428d3..0c41344187a 100644 --- a/packages/typespec-python/test/unbranded/generated/versioning-removed/versioning/removed/aio/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/versioning-removed/versioning/removed/aio/_operations/_operations.py @@ -115,7 +115,7 @@ async def v2(self, body: Union[_models.ModelV2, JSON, IO[bytes]], **kwargs: Any) params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -233,7 +233,7 @@ async def model_v3(self, body: Union[_models.ModelV3, JSON, IO[bytes]], **kwargs params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) diff --git a/packages/typespec-python/test/unbranded/generated/versioning-renamedfrom/versioning/renamedfrom/_client.py b/packages/typespec-python/test/unbranded/generated/versioning-renamedfrom/versioning/renamedfrom/_client.py index 70ec338a5fe..cb0eccc3835 100644 --- a/packages/typespec-python/test/unbranded/generated/versioning-renamedfrom/versioning/renamedfrom/_client.py +++ b/packages/typespec-python/test/unbranded/generated/versioning-renamedfrom/versioning/renamedfrom/_client.py @@ -69,7 +69,7 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), } diff --git a/packages/typespec-python/test/unbranded/generated/versioning-renamedfrom/versioning/renamedfrom/aio/_client.py b/packages/typespec-python/test/unbranded/generated/versioning-renamedfrom/versioning/renamedfrom/aio/_client.py index 8acff4f612c..39d54324317 100644 --- a/packages/typespec-python/test/unbranded/generated/versioning-renamedfrom/versioning/renamedfrom/aio/_client.py +++ b/packages/typespec-python/test/unbranded/generated/versioning-renamedfrom/versioning/renamedfrom/aio/_client.py @@ -71,7 +71,7 @@ def send_request( request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), } diff --git a/packages/typespec-python/test/unbranded/generated/versioning-renamedfrom/versioning/renamedfrom/aio/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/versioning-renamedfrom/versioning/renamedfrom/aio/operations/_operations.py index 99159550264..e7a2c5e3155 100644 --- a/packages/typespec-python/test/unbranded/generated/versioning-renamedfrom/versioning/renamedfrom/aio/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/versioning-renamedfrom/versioning/renamedfrom/aio/operations/_operations.py @@ -142,7 +142,7 @@ async def new_op_in_new_interface( params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -270,7 +270,7 @@ async def new_op( params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) diff --git a/packages/typespec-python/test/unbranded/generated/versioning-renamedfrom/versioning/renamedfrom/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/versioning-renamedfrom/versioning/renamedfrom/operations/_operations.py index 68ec2b20100..2c623afcd99 100644 --- a/packages/typespec-python/test/unbranded/generated/versioning-renamedfrom/versioning/renamedfrom/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/versioning-renamedfrom/versioning/renamedfrom/operations/_operations.py @@ -179,7 +179,7 @@ def new_op_in_new_interface( params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -307,7 +307,7 @@ def new_op( params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) diff --git a/packages/typespec-python/test/unbranded/generated/versioning-returntypechangedfrom/versioning/returntypechangedfrom/_client.py b/packages/typespec-python/test/unbranded/generated/versioning-returntypechangedfrom/versioning/returntypechangedfrom/_client.py index 6091fd1ba2a..45f89102886 100644 --- a/packages/typespec-python/test/unbranded/generated/versioning-returntypechangedfrom/versioning/returntypechangedfrom/_client.py +++ b/packages/typespec-python/test/unbranded/generated/versioning-returntypechangedfrom/versioning/returntypechangedfrom/_client.py @@ -68,7 +68,7 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), } diff --git a/packages/typespec-python/test/unbranded/generated/versioning-returntypechangedfrom/versioning/returntypechangedfrom/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/versioning-returntypechangedfrom/versioning/returntypechangedfrom/_operations/_operations.py index abf6bc8eca3..4c55fbd289f 100644 --- a/packages/typespec-python/test/unbranded/generated/versioning-returntypechangedfrom/versioning/returntypechangedfrom/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/versioning-returntypechangedfrom/versioning/returntypechangedfrom/_operations/_operations.py @@ -1,4 +1,5 @@ # coding=utf-8 +import json import sys from typing import Any, Callable, Dict, Optional, TypeVar @@ -16,7 +17,7 @@ from corehttp.runtime.pipeline import PipelineResponse from corehttp.utils import case_insensitive_dict -from .._model_base import _deserialize +from .._model_base import SdkJSONEncoder, _deserialize from .._serialization import Serializer from .._vendor import ReturnTypeChangedFromClientMixinABC @@ -41,7 +42,7 @@ def build_return_type_changed_from_test_request(**kwargs: Any) -> HttpRequest: _url = "/test" # Construct headers - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _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) @@ -69,10 +70,10 @@ def test(self, body: str, **kwargs: Any) -> str: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "text/plain")) + content_type: str = kwargs.pop("content_type", _headers.pop("content-type", "application/json")) cls: ClsType[str] = kwargs.pop("cls", None) - _content = body + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_return_type_changed_from_test_request( content_type=content_type, @@ -81,7 +82,7 @@ def test(self, body: str, **kwargs: Any) -> str: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) diff --git a/packages/typespec-python/test/unbranded/generated/versioning-returntypechangedfrom/versioning/returntypechangedfrom/aio/_client.py b/packages/typespec-python/test/unbranded/generated/versioning-returntypechangedfrom/versioning/returntypechangedfrom/aio/_client.py index cd7ac332b3c..94c04a16ef9 100644 --- a/packages/typespec-python/test/unbranded/generated/versioning-returntypechangedfrom/versioning/returntypechangedfrom/aio/_client.py +++ b/packages/typespec-python/test/unbranded/generated/versioning-returntypechangedfrom/versioning/returntypechangedfrom/aio/_client.py @@ -70,7 +70,7 @@ def send_request( request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), } diff --git a/packages/typespec-python/test/unbranded/generated/versioning-returntypechangedfrom/versioning/returntypechangedfrom/aio/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/versioning-returntypechangedfrom/versioning/returntypechangedfrom/aio/_operations/_operations.py index 47f0ab8a622..8c47b1ea997 100644 --- a/packages/typespec-python/test/unbranded/generated/versioning-returntypechangedfrom/versioning/returntypechangedfrom/aio/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/versioning-returntypechangedfrom/versioning/returntypechangedfrom/aio/_operations/_operations.py @@ -1,4 +1,5 @@ # coding=utf-8 +import json import sys from typing import Any, Callable, Dict, Optional, TypeVar @@ -16,7 +17,7 @@ from corehttp.runtime.pipeline import PipelineResponse from corehttp.utils import case_insensitive_dict -from ..._model_base import _deserialize +from ..._model_base import SdkJSONEncoder, _deserialize from ..._operations._operations import build_return_type_changed_from_test_request from .._vendor import ReturnTypeChangedFromClientMixinABC @@ -50,10 +51,10 @@ async def test(self, body: str, **kwargs: Any) -> str: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = kwargs.pop("params", {}) or {} - content_type: str = kwargs.pop("content_type", _headers.pop("Content-Type", "text/plain")) + content_type: str = kwargs.pop("content_type", _headers.pop("content-type", "application/json")) cls: ClsType[str] = kwargs.pop("cls", None) - _content = body + _content = json.dumps(body, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore _request = build_return_type_changed_from_test_request( content_type=content_type, @@ -62,7 +63,7 @@ async def test(self, body: str, **kwargs: Any) -> str: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) diff --git a/packages/typespec-python/test/unbranded/generated/versioning-typechangedfrom/versioning/typechangedfrom/_client.py b/packages/typespec-python/test/unbranded/generated/versioning-typechangedfrom/versioning/typechangedfrom/_client.py index 4762e5701bc..b4eeddf80d8 100644 --- a/packages/typespec-python/test/unbranded/generated/versioning-typechangedfrom/versioning/typechangedfrom/_client.py +++ b/packages/typespec-python/test/unbranded/generated/versioning-typechangedfrom/versioning/typechangedfrom/_client.py @@ -66,7 +66,7 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), } diff --git a/packages/typespec-python/test/unbranded/generated/versioning-typechangedfrom/versioning/typechangedfrom/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/versioning-typechangedfrom/versioning/typechangedfrom/_operations/_operations.py index 279094199ba..d7df9956fdf 100644 --- a/packages/typespec-python/test/unbranded/generated/versioning-typechangedfrom/versioning/typechangedfrom/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/versioning-typechangedfrom/versioning/typechangedfrom/_operations/_operations.py @@ -152,7 +152,7 @@ def test(self, body: Union[_models.TestModel, JSON, IO[bytes]], *, param: str, * params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) diff --git a/packages/typespec-python/test/unbranded/generated/versioning-typechangedfrom/versioning/typechangedfrom/aio/_client.py b/packages/typespec-python/test/unbranded/generated/versioning-typechangedfrom/versioning/typechangedfrom/aio/_client.py index c98c5fce524..08ba454bf31 100644 --- a/packages/typespec-python/test/unbranded/generated/versioning-typechangedfrom/versioning/typechangedfrom/aio/_client.py +++ b/packages/typespec-python/test/unbranded/generated/versioning-typechangedfrom/versioning/typechangedfrom/aio/_client.py @@ -68,7 +68,7 @@ def send_request( request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), } diff --git a/packages/typespec-python/test/unbranded/generated/versioning-typechangedfrom/versioning/typechangedfrom/aio/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/versioning-typechangedfrom/versioning/typechangedfrom/aio/_operations/_operations.py index 13449888fa1..b370eceeba5 100644 --- a/packages/typespec-python/test/unbranded/generated/versioning-typechangedfrom/versioning/typechangedfrom/aio/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/versioning-typechangedfrom/versioning/typechangedfrom/aio/_operations/_operations.py @@ -130,7 +130,7 @@ async def test( params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), } _request.url = self._client.format_url(_request.url, **path_format_arguments) From 14b8bdf51dd131f74640f7da5a8aa803f167e5fa Mon Sep 17 00:00:00 2001 From: AutoPrFromHttpClientPython Date: Tue, 1 Apr 2025 06:47:26 +0000 Subject: [PATCH 03/19] Update dependencies (2025-04-01 06:47:26) --- packages/autorest.python/package.json | 2 +- packages/typespec-python/package.json | 6 +- pnpm-lock.yaml | 80 +++++++++++++-------------- 3 files changed, 44 insertions(+), 44 deletions(-) diff --git a/packages/autorest.python/package.json b/packages/autorest.python/package.json index 9bae9b6d283..574359fe8f9 100644 --- a/packages/autorest.python/package.json +++ b/packages/autorest.python/package.json @@ -29,7 +29,7 @@ }, "homepage": "https://github.com/Azure/autorest.python/blob/main/README.md", "dependencies": { - "@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcwNTAzNi9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.2.tgz", + "@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcwOTA2Mi9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.2.tgz", "@autorest/system-requirements": "~1.0.2", "fs-extra": "~11.2.0", "tsx": "~4.19.1" diff --git a/packages/typespec-python/package.json b/packages/typespec-python/package.json index 557a369998f..8f176d1e578 100644 --- a/packages/typespec-python/package.json +++ b/packages/typespec-python/package.json @@ -57,13 +57,13 @@ "@azure-tools/typespec-azure-resource-manager": ">=0.54.0-dev.3 <1.0.0", "@azure-tools/typespec-autorest": ">=0.54.0-dev.5 <1.0.0", "@azure-tools/typespec-azure-rulesets": ">=0.54.0-dev.2 <3.0.0", - "@azure-tools/typespec-client-generator-core": ">=0.54.0-dev.16 <1.0.0" + "@azure-tools/typespec-client-generator-core": ">=0.54.0-dev.19 <1.0.0" }, "dependencies": { "js-yaml": "~4.1.0", "semver": "~7.6.2", "tsx": "~4.19.1", - "@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcwNTAzNi9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.2.tgz", + "@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcwOTA2Mi9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.2.tgz", "fs-extra": "~11.2.0" }, "devDependencies": { @@ -79,7 +79,7 @@ "@azure-tools/typespec-azure-core": "~0.54.0-dev.5", "@azure-tools/typespec-azure-rulesets": "~0.54.0-dev.2", "@azure-tools/typespec-autorest": "~0.54.0-dev.5", - "@azure-tools/typespec-client-generator-core": "~0.54.0-dev.16", + "@azure-tools/typespec-client-generator-core": "~0.54.0-dev.19", "@azure-tools/azure-http-specs": "0.1.0-alpha.13-dev.1", "@typespec/http-specs": "0.1.0-alpha.17-dev.1", "@types/js-yaml": "~4.0.5", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 28655f46ad7..d0880f3b1d4 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -57,8 +57,8 @@ importers: specifier: ~1.0.2 version: 1.0.2 '@typespec/http-client-python': - specifier: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcwNTAzNi9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.2.tgz - version: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcwNTAzNi9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.2.tgz(iqakddphdaprnwwnwak65rubwq) + specifier: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcwOTA2Mi9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.2.tgz + version: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcwOTA2Mi9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.2.tgz(vc45nnffght74sl4sibvll3pxy) fs-extra: specifier: ~11.2.0 version: 11.2.0 @@ -79,8 +79,8 @@ importers: packages/typespec-python: dependencies: '@typespec/http-client-python': - specifier: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcwNTAzNi9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.2.tgz - version: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcwNTAzNi9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.2.tgz(iutp5t4avvqu5ejcubt66dygha) + specifier: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcwOTA2Mi9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.2.tgz + version: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcwOTA2Mi9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.2.tgz(vqafh2xgemu2dyfvlgvmut4cti) fs-extra: specifier: ~11.2.0 version: 11.2.0 @@ -99,7 +99,7 @@ importers: version: 0.1.0-alpha.13-dev.1(dkz3jopup3kcww2tc3n27h5adi) '@azure-tools/typespec-autorest': specifier: ~0.54.0-dev.5 - version: 0.54.0-dev.5(vbjiszjdl42dvuq2wpgzxde7nu) + version: 0.54.0-dev.5(terlvcbdqtyv3m5pmsko2l6fny) '@azure-tools/typespec-azure-core': specifier: ~0.54.0-dev.5 version: 0.54.0-dev.5(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))(@typespec/rest@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))) @@ -108,10 +108,10 @@ importers: version: 0.54.0-dev.3(vvsjt7ss6dhpuzy2lahlecfu7a) '@azure-tools/typespec-azure-rulesets': specifier: ~0.54.0-dev.2 - version: 0.54.0-dev.2(@azure-tools/typespec-azure-core@0.54.0-dev.5(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))(@typespec/rest@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))))(@azure-tools/typespec-azure-resource-manager@0.54.0-dev.3(vvsjt7ss6dhpuzy2lahlecfu7a))(@azure-tools/typespec-client-generator-core@0.54.0-dev.17(bi3uo6v4m3cwrf7tvdzqjmlfka))(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)) + version: 0.54.0-dev.2(@azure-tools/typespec-azure-core@0.54.0-dev.5(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))(@typespec/rest@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))))(@azure-tools/typespec-azure-resource-manager@0.54.0-dev.3(vvsjt7ss6dhpuzy2lahlecfu7a))(@azure-tools/typespec-client-generator-core@0.54.0-dev.19(bi3uo6v4m3cwrf7tvdzqjmlfka))(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)) '@azure-tools/typespec-client-generator-core': - specifier: ~0.54.0-dev.16 - version: 0.54.0-dev.17(bi3uo6v4m3cwrf7tvdzqjmlfka) + specifier: ~0.54.0-dev.19 + version: 0.54.0-dev.19(bi3uo6v4m3cwrf7tvdzqjmlfka) '@types/fs-extra': specifier: 11.0.4 version: 11.0.4 @@ -240,8 +240,8 @@ packages: '@azure-tools/typespec-client-generator-core': ^0.53.1 || >=0.54.0-dev <0.54.0 '@typespec/compiler': ^0.67.1 || >=0.68.0-dev <0.68.0 - '@azure-tools/typespec-client-generator-core@0.54.0-dev.17': - resolution: {integrity: sha512-Z+pSc18+K3PPdfmA4xi6VApQFMlqWhIOhO71v1/k/lGoBAi0D965X0TRYdqHeJ7iNPMfhh+G7GR2d31COEDSkw==} + '@azure-tools/typespec-client-generator-core@0.54.0-dev.19': + resolution: {integrity: sha512-sMCAtM9AMH6BuE4r4P5G3LVpon5YFfTQgPeSCYlAVpOxNdnx4g2qFFuE1Lsb1lHfHVPU3ZLRlGfFtOcJWLN1/Q==} engines: {node: '>=20.0.0'} peerDependencies: '@azure-tools/typespec-azure-core': ^0.53.0 || >=0.54.0-dev <0.54.0 @@ -1659,8 +1659,8 @@ packages: peerDependencies: '@typespec/compiler': ^0.67.1 || >=0.68.0-dev <0.68.0 - '@typespec/http-client-python@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcwNTAzNi9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.2.tgz': - resolution: {tarball: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcwNTAzNi9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.2.tgz} + '@typespec/http-client-python@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcwOTA2Mi9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.2.tgz': + resolution: {tarball: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcwOTA2Mi9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.2.tgz} version: 0.8.2 engines: {node: '>=20.0.0'} peerDependencies: @@ -1668,7 +1668,7 @@ packages: '@azure-tools/typespec-azure-core': '>=0.54.0-dev.5 <1.0.0' '@azure-tools/typespec-azure-resource-manager': '>=0.54.0-dev.3 <1.0.0' '@azure-tools/typespec-azure-rulesets': '>=0.54.0-dev.2 <3.0.0' - '@azure-tools/typespec-client-generator-core': '>=0.54.0-dev.16 <1.0.0' + '@azure-tools/typespec-client-generator-core': '>=0.54.0-dev.19 <1.0.0' '@typespec/compiler': '>=0.68.0-dev.11 <1.0.0' '@typespec/events': '>=0.68.0-dev.2 <1.0.0' '@typespec/http': '>=0.68.0-dev.8 <1.0.0' @@ -4586,28 +4586,28 @@ snapshots: - '@typespec/streams' - supports-color - '@azure-tools/typespec-autorest@0.54.0-dev.5(vbjiszjdl42dvuq2wpgzxde7nu)': - dependencies: - '@azure-tools/typespec-azure-core': 0.54.0-dev.5(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))(@typespec/rest@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))) - '@azure-tools/typespec-azure-resource-manager': 0.54.0-dev.3(vvsjt7ss6dhpuzy2lahlecfu7a) - '@azure-tools/typespec-client-generator-core': 0.54.0-dev.17(bi3uo6v4m3cwrf7tvdzqjmlfka) - '@typespec/compiler': 0.68.0-dev.12(@types/node@22.5.5) - '@typespec/http': 0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))) - '@typespec/openapi': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)))) - '@typespec/rest': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)))) - '@typespec/versioning': 0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)) - - '@azure-tools/typespec-autorest@0.54.0-dev.5(zatd3rwsnwvs4pr3qbbtcvlpxe)': + '@azure-tools/typespec-autorest@0.54.0-dev.5(sc7idhpgkzao6ca27f5n4spwdm)': dependencies: '@azure-tools/typespec-azure-core': 0.54.0-dev.5(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))))(@typespec/rest@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))))) '@azure-tools/typespec-azure-resource-manager': 0.54.0-dev.3(v3vj4toze5ay2f53uheih2fore) - '@azure-tools/typespec-client-generator-core': 0.54.0-dev.17(x4iqah4tm4sou6fo55o2ec4yze) + '@azure-tools/typespec-client-generator-core': 0.54.0-dev.19(x4iqah4tm4sou6fo55o2ec4yze) '@typespec/compiler': 0.68.0-dev.12(@types/node@22.13.10) '@typespec/http': 0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))) '@typespec/openapi': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10)))) '@typespec/rest': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10)))) '@typespec/versioning': 0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10)) + '@azure-tools/typespec-autorest@0.54.0-dev.5(terlvcbdqtyv3m5pmsko2l6fny)': + dependencies: + '@azure-tools/typespec-azure-core': 0.54.0-dev.5(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))(@typespec/rest@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))) + '@azure-tools/typespec-azure-resource-manager': 0.54.0-dev.3(vvsjt7ss6dhpuzy2lahlecfu7a) + '@azure-tools/typespec-client-generator-core': 0.54.0-dev.19(bi3uo6v4m3cwrf7tvdzqjmlfka) + '@typespec/compiler': 0.68.0-dev.12(@types/node@22.5.5) + '@typespec/http': 0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))) + '@typespec/openapi': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)))) + '@typespec/rest': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)))) + '@typespec/versioning': 0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)) + '@azure-tools/typespec-azure-core@0.54.0-dev.5(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))))(@typespec/rest@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10)))))': dependencies: '@typespec/compiler': 0.68.0-dev.12(@types/node@22.13.10) @@ -4642,21 +4642,21 @@ snapshots: change-case: 5.4.4 pluralize: 8.0.0 - '@azure-tools/typespec-azure-rulesets@0.54.0-dev.2(@azure-tools/typespec-azure-core@0.54.0-dev.5(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))))(@typespec/rest@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))))))(@azure-tools/typespec-azure-resource-manager@0.54.0-dev.3(v3vj4toze5ay2f53uheih2fore))(@azure-tools/typespec-client-generator-core@0.54.0-dev.17(x4iqah4tm4sou6fo55o2ec4yze))(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))': + '@azure-tools/typespec-azure-rulesets@0.54.0-dev.2(@azure-tools/typespec-azure-core@0.54.0-dev.5(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))))(@typespec/rest@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))))))(@azure-tools/typespec-azure-resource-manager@0.54.0-dev.3(v3vj4toze5ay2f53uheih2fore))(@azure-tools/typespec-client-generator-core@0.54.0-dev.19(x4iqah4tm4sou6fo55o2ec4yze))(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))': dependencies: '@azure-tools/typespec-azure-core': 0.54.0-dev.5(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))))(@typespec/rest@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))))) '@azure-tools/typespec-azure-resource-manager': 0.54.0-dev.3(v3vj4toze5ay2f53uheih2fore) - '@azure-tools/typespec-client-generator-core': 0.54.0-dev.17(x4iqah4tm4sou6fo55o2ec4yze) + '@azure-tools/typespec-client-generator-core': 0.54.0-dev.19(x4iqah4tm4sou6fo55o2ec4yze) '@typespec/compiler': 0.68.0-dev.12(@types/node@22.13.10) - '@azure-tools/typespec-azure-rulesets@0.54.0-dev.2(@azure-tools/typespec-azure-core@0.54.0-dev.5(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))(@typespec/rest@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))))(@azure-tools/typespec-azure-resource-manager@0.54.0-dev.3(vvsjt7ss6dhpuzy2lahlecfu7a))(@azure-tools/typespec-client-generator-core@0.54.0-dev.17(bi3uo6v4m3cwrf7tvdzqjmlfka))(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))': + '@azure-tools/typespec-azure-rulesets@0.54.0-dev.2(@azure-tools/typespec-azure-core@0.54.0-dev.5(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))(@typespec/rest@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))))(@azure-tools/typespec-azure-resource-manager@0.54.0-dev.3(vvsjt7ss6dhpuzy2lahlecfu7a))(@azure-tools/typespec-client-generator-core@0.54.0-dev.19(bi3uo6v4m3cwrf7tvdzqjmlfka))(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))': dependencies: '@azure-tools/typespec-azure-core': 0.54.0-dev.5(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))(@typespec/rest@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))) '@azure-tools/typespec-azure-resource-manager': 0.54.0-dev.3(vvsjt7ss6dhpuzy2lahlecfu7a) - '@azure-tools/typespec-client-generator-core': 0.54.0-dev.17(bi3uo6v4m3cwrf7tvdzqjmlfka) + '@azure-tools/typespec-client-generator-core': 0.54.0-dev.19(bi3uo6v4m3cwrf7tvdzqjmlfka) '@typespec/compiler': 0.68.0-dev.12(@types/node@22.5.5) - '@azure-tools/typespec-client-generator-core@0.54.0-dev.17(bi3uo6v4m3cwrf7tvdzqjmlfka)': + '@azure-tools/typespec-client-generator-core@0.54.0-dev.19(bi3uo6v4m3cwrf7tvdzqjmlfka)': dependencies: '@azure-tools/typespec-azure-core': 0.54.0-dev.5(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))(@typespec/rest@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))) '@typespec/compiler': 0.68.0-dev.12(@types/node@22.5.5) @@ -4672,7 +4672,7 @@ snapshots: pluralize: 8.0.0 yaml: 2.7.0 - '@azure-tools/typespec-client-generator-core@0.54.0-dev.17(x4iqah4tm4sou6fo55o2ec4yze)': + '@azure-tools/typespec-client-generator-core@0.54.0-dev.19(x4iqah4tm4sou6fo55o2ec4yze)': dependencies: '@azure-tools/typespec-azure-core': 0.54.0-dev.5(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))))(@typespec/rest@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))))) '@typespec/compiler': 0.68.0-dev.12(@types/node@22.13.10) @@ -6337,13 +6337,13 @@ snapshots: dependencies: '@typespec/compiler': 0.68.0-dev.12(@types/node@22.5.5) - '@typespec/http-client-python@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcwNTAzNi9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.2.tgz(iqakddphdaprnwwnwak65rubwq)': + '@typespec/http-client-python@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcwOTA2Mi9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.2.tgz(vc45nnffght74sl4sibvll3pxy)': dependencies: - '@azure-tools/typespec-autorest': 0.54.0-dev.5(zatd3rwsnwvs4pr3qbbtcvlpxe) + '@azure-tools/typespec-autorest': 0.54.0-dev.5(sc7idhpgkzao6ca27f5n4spwdm) '@azure-tools/typespec-azure-core': 0.54.0-dev.5(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))))(@typespec/rest@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))))) '@azure-tools/typespec-azure-resource-manager': 0.54.0-dev.3(v3vj4toze5ay2f53uheih2fore) - '@azure-tools/typespec-azure-rulesets': 0.54.0-dev.2(@azure-tools/typespec-azure-core@0.54.0-dev.5(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))))(@typespec/rest@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))))))(@azure-tools/typespec-azure-resource-manager@0.54.0-dev.3(v3vj4toze5ay2f53uheih2fore))(@azure-tools/typespec-client-generator-core@0.54.0-dev.17(x4iqah4tm4sou6fo55o2ec4yze))(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10)) - '@azure-tools/typespec-client-generator-core': 0.54.0-dev.17(x4iqah4tm4sou6fo55o2ec4yze) + '@azure-tools/typespec-azure-rulesets': 0.54.0-dev.2(@azure-tools/typespec-azure-core@0.54.0-dev.5(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))))(@typespec/rest@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))))))(@azure-tools/typespec-azure-resource-manager@0.54.0-dev.3(v3vj4toze5ay2f53uheih2fore))(@azure-tools/typespec-client-generator-core@0.54.0-dev.19(x4iqah4tm4sou6fo55o2ec4yze))(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10)) + '@azure-tools/typespec-client-generator-core': 0.54.0-dev.19(x4iqah4tm4sou6fo55o2ec4yze) '@typespec/compiler': 0.68.0-dev.12(@types/node@22.13.10) '@typespec/events': 0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10)) '@typespec/http': 0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))) @@ -6361,13 +6361,13 @@ snapshots: - bufferutil - utf-8-validate - '@typespec/http-client-python@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcwNTAzNi9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.2.tgz(iutp5t4avvqu5ejcubt66dygha)': + '@typespec/http-client-python@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcwOTA2Mi9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.2.tgz(vqafh2xgemu2dyfvlgvmut4cti)': dependencies: - '@azure-tools/typespec-autorest': 0.54.0-dev.5(vbjiszjdl42dvuq2wpgzxde7nu) + '@azure-tools/typespec-autorest': 0.54.0-dev.5(terlvcbdqtyv3m5pmsko2l6fny) '@azure-tools/typespec-azure-core': 0.54.0-dev.5(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))(@typespec/rest@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))) '@azure-tools/typespec-azure-resource-manager': 0.54.0-dev.3(vvsjt7ss6dhpuzy2lahlecfu7a) - '@azure-tools/typespec-azure-rulesets': 0.54.0-dev.2(@azure-tools/typespec-azure-core@0.54.0-dev.5(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))(@typespec/rest@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))))(@azure-tools/typespec-azure-resource-manager@0.54.0-dev.3(vvsjt7ss6dhpuzy2lahlecfu7a))(@azure-tools/typespec-client-generator-core@0.54.0-dev.17(bi3uo6v4m3cwrf7tvdzqjmlfka))(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)) - '@azure-tools/typespec-client-generator-core': 0.54.0-dev.17(bi3uo6v4m3cwrf7tvdzqjmlfka) + '@azure-tools/typespec-azure-rulesets': 0.54.0-dev.2(@azure-tools/typespec-azure-core@0.54.0-dev.5(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))(@typespec/rest@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))))(@azure-tools/typespec-azure-resource-manager@0.54.0-dev.3(vvsjt7ss6dhpuzy2lahlecfu7a))(@azure-tools/typespec-client-generator-core@0.54.0-dev.19(bi3uo6v4m3cwrf7tvdzqjmlfka))(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)) + '@azure-tools/typespec-client-generator-core': 0.54.0-dev.19(bi3uo6v4m3cwrf7tvdzqjmlfka) '@typespec/compiler': 0.68.0-dev.12(@types/node@22.5.5) '@typespec/events': 0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)) '@typespec/http': 0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))) From 9c76120aa29b3dfac1cb91e9d5ac1c316e182f1e Mon Sep 17 00:00:00 2001 From: AutoPrFromHttpClientPython Date: Tue, 1 Apr 2025 06:51:53 +0000 Subject: [PATCH 04/19] Regenerate for typespec-python (2025-04-01 06:51:53) --- .../client/structure/service/_client.py | 4 +- .../client/structure/service/aio/_client.py | 4 +- .../service/aio/operations/_operations.py | 36 +++++++-------- .../service/operations/_operations.py | 36 +++++++-------- .../client/structure/multiclient/_client.py | 8 ++-- .../multiclient/_operations/_operations.py | 24 +++++----- .../structure/multiclient/aio/_client.py | 8 ++-- .../aio/_operations/_operations.py | 24 +++++----- .../structure/renamedoperation/_client.py | 4 +- .../structure/renamedoperation/aio/_client.py | 4 +- .../aio/operations/_operations.py | 24 +++++----- .../operations/_operations.py | 24 +++++----- .../structure/twooperationgroup/_client.py | 4 +- .../twooperationgroup/aio/_client.py | 4 +- .../aio/operations/_operations.py | 24 +++++----- .../operations/_operations.py | 24 +++++----- .../resiliency/srv/driven1/_client.py | 11 ++--- .../srv/driven1/_operations/_operations.py | 33 ++++---------- .../resiliency/srv/driven1/aio/_client.py | 11 ++--- .../driven1/aio/_operations/_operations.py | 33 ++++---------- .../resiliency/srv/driven2/_client.py | 11 ++--- .../srv/driven2/_operations/_operations.py | 44 +++++-------------- .../resiliency/srv/driven2/aio/_client.py | 11 ++--- .../driven2/aio/_operations/_operations.py | 44 +++++-------------- .../server/path/multiple/_client.py | 6 +-- .../path/multiple/_operations/_operations.py | 12 ++--- .../server/path/multiple/aio/_client.py | 6 +-- .../multiple/aio/_operations/_operations.py | 12 ++--- .../server/path/single/_client.py | 2 +- .../path/single/_operations/_operations.py | 2 +- .../server/path/single/aio/_client.py | 2 +- .../single/aio/_operations/_operations.py | 2 +- .../server/versions/notversioned/_client.py | 2 +- .../notversioned/_operations/_operations.py | 6 +-- .../versions/notversioned/aio/_client.py | 2 +- .../aio/_operations/_operations.py | 6 +-- .../server/versions/versioned/_client.py | 2 +- .../versioned/_operations/_operations.py | 8 ++-- .../server/versions/versioned/aio/_client.py | 2 +- .../versioned/aio/_operations/_operations.py | 8 ++-- .../versioning/added/_client.py | 4 +- .../versioning/added/aio/_client.py | 4 +- .../added/aio/operations/_operations.py | 12 ++--- .../added/operations/_operations.py | 12 ++--- .../versioning/madeoptional/_client.py | 4 +- .../madeoptional/_operations/_operations.py | 4 +- .../versioning/madeoptional/aio/_client.py | 4 +- .../aio/_operations/_operations.py | 4 +- .../versioning/removed/_client.py | 4 +- .../removed/_operations/_operations.py | 8 ++-- .../versioning/removed/aio/_client.py | 4 +- .../removed/aio/_operations/_operations.py | 8 ++-- .../versioning/renamedfrom/_client.py | 4 +- .../versioning/renamedfrom/aio/_client.py | 4 +- .../renamedfrom/aio/operations/_operations.py | 8 ++-- .../renamedfrom/operations/_operations.py | 8 ++-- .../returntypechangedfrom/_client.py | 4 +- .../_operations/_operations.py | 4 +- .../returntypechangedfrom/aio/_client.py | 4 +- .../aio/_operations/_operations.py | 4 +- .../versioning/typechangedfrom/_client.py | 4 +- .../_operations/_operations.py | 4 +- .../versioning/typechangedfrom/aio/_client.py | 4 +- .../aio/_operations/_operations.py | 4 +- .../server/path/multiple/_client.py | 6 +-- .../path/multiple/_operations/_operations.py | 12 ++--- .../server/path/multiple/aio/_client.py | 6 +-- .../multiple/aio/_operations/_operations.py | 12 ++--- .../server/path/single/_client.py | 2 +- .../path/single/_operations/_operations.py | 2 +- .../server/path/single/aio/_client.py | 2 +- .../single/aio/_operations/_operations.py | 2 +- .../server/versions/notversioned/_client.py | 2 +- .../notversioned/_operations/_operations.py | 6 +-- .../versions/notversioned/aio/_client.py | 2 +- .../aio/_operations/_operations.py | 6 +-- .../server/versions/versioned/_client.py | 2 +- .../versioned/_operations/_operations.py | 8 ++-- .../server/versions/versioned/aio/_client.py | 2 +- .../versioned/aio/_operations/_operations.py | 8 ++-- .../versioning/added/_client.py | 4 +- .../versioning/added/aio/_client.py | 4 +- .../added/aio/operations/_operations.py | 12 ++--- .../added/operations/_operations.py | 12 ++--- .../versioning/madeoptional/_client.py | 4 +- .../madeoptional/_operations/_operations.py | 4 +- .../versioning/madeoptional/aio/_client.py | 4 +- .../aio/_operations/_operations.py | 4 +- .../versioning/removed/_client.py | 4 +- .../removed/_operations/_operations.py | 8 ++-- .../versioning/removed/aio/_client.py | 4 +- .../removed/aio/_operations/_operations.py | 8 ++-- .../versioning/renamedfrom/_client.py | 4 +- .../versioning/renamedfrom/aio/_client.py | 4 +- .../renamedfrom/aio/operations/_operations.py | 8 ++-- .../renamedfrom/operations/_operations.py | 8 ++-- .../returntypechangedfrom/_client.py | 4 +- .../_operations/_operations.py | 4 +- .../returntypechangedfrom/aio/_client.py | 4 +- .../aio/_operations/_operations.py | 4 +- .../versioning/typechangedfrom/_client.py | 4 +- .../_operations/_operations.py | 4 +- .../versioning/typechangedfrom/aio/_client.py | 4 +- .../aio/_operations/_operations.py | 4 +- 104 files changed, 378 insertions(+), 492 deletions(-) diff --git a/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/_client.py b/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/_client.py index c3e95c1e9b6..95c8259c2a7 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/_client.py +++ b/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/_client.py @@ -94,8 +94,8 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "client": self._serialize.url("self._config.client", self._config.client, "str"), } request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) diff --git a/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/aio/_client.py b/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/aio/_client.py index 82760e2fb28..30c382c245d 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/aio/_client.py +++ b/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/aio/_client.py @@ -96,8 +96,8 @@ def send_request( request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "client": self._serialize.url("self._config.client", self._config.client, "str"), } request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) diff --git a/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/aio/operations/_operations.py index 4a41acc6cde..ea6a3775882 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/aio/operations/_operations.py @@ -104,8 +104,8 @@ async def eight(self, **kwargs: Any) -> None: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "client": self._serialize.url("self._config.client", self._config.client, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -167,8 +167,8 @@ async def three(self, **kwargs: Any) -> None: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "client": self._serialize.url("self._config.client", self._config.client, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -212,8 +212,8 @@ async def four(self, **kwargs: Any) -> None: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "client": self._serialize.url("self._config.client", self._config.client, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -275,8 +275,8 @@ async def five(self, **kwargs: Any) -> None: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "client": self._serialize.url("self._config.client", self._config.client, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -320,8 +320,8 @@ async def six(self, **kwargs: Any) -> None: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "client": self._serialize.url("self._config.client", self._config.client, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -368,8 +368,8 @@ async def one(self, **kwargs: Any) -> None: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "client": self._serialize.url("self._config.client", self._config.client, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -413,8 +413,8 @@ async def two(self, **kwargs: Any) -> None: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "client": self._serialize.url("self._config.client", self._config.client, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -476,8 +476,8 @@ async def seven(self, **kwargs: Any) -> None: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "client": self._serialize.url("self._config.client", self._config.client, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -539,8 +539,8 @@ async def nine(self, **kwargs: Any) -> None: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "client": self._serialize.url("self._config.client", self._config.client, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) diff --git a/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/operations/_operations.py b/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/operations/_operations.py index 9c49e5f0def..768cc3b3ce3 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/client-structure-default/client/structure/service/operations/_operations.py @@ -158,8 +158,8 @@ def eight(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-s params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "client": self._serialize.url("self._config.client", self._config.client, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -221,8 +221,8 @@ def three(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-s params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "client": self._serialize.url("self._config.client", self._config.client, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -266,8 +266,8 @@ def four(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-st params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "client": self._serialize.url("self._config.client", self._config.client, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -329,8 +329,8 @@ def five(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-st params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "client": self._serialize.url("self._config.client", self._config.client, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -374,8 +374,8 @@ def six(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-sta params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "client": self._serialize.url("self._config.client", self._config.client, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -422,8 +422,8 @@ def one(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-sta params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "client": self._serialize.url("self._config.client", self._config.client, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -467,8 +467,8 @@ def two(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-sta params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "client": self._serialize.url("self._config.client", self._config.client, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -530,8 +530,8 @@ def seven(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-s params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "client": self._serialize.url("self._config.client", self._config.client, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -593,8 +593,8 @@ def nine(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-st params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "client": self._serialize.url("self._config.client", self._config.client, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) diff --git a/packages/typespec-python/test/azure/generated/client-structure-multiclient/client/structure/multiclient/_client.py b/packages/typespec-python/test/azure/generated/client-structure-multiclient/client/structure/multiclient/_client.py index 0ec5e34a6ca..7508f5bee71 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-multiclient/client/structure/multiclient/_client.py +++ b/packages/typespec-python/test/azure/generated/client-structure-multiclient/client/structure/multiclient/_client.py @@ -74,8 +74,8 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "client": self._serialize.url("self._config.client", self._config.client, "str"), } request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) @@ -152,8 +152,8 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "client": self._serialize.url("self._config.client", self._config.client, "str"), } request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) diff --git a/packages/typespec-python/test/azure/generated/client-structure-multiclient/client/structure/multiclient/_operations/_operations.py b/packages/typespec-python/test/azure/generated/client-structure-multiclient/client/structure/multiclient/_operations/_operations.py index cffd9534765..43146ba2b45 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-multiclient/client/structure/multiclient/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/client-structure-multiclient/client/structure/multiclient/_operations/_operations.py @@ -98,8 +98,8 @@ def renamed_one(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-re params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "client": self._serialize.url("self._config.client", self._config.client, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -143,8 +143,8 @@ def renamed_three(self, **kwargs: Any) -> None: # pylint: disable=inconsistent- params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "client": self._serialize.url("self._config.client", self._config.client, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -188,8 +188,8 @@ def renamed_five(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-r params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "client": self._serialize.url("self._config.client", self._config.client, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -236,8 +236,8 @@ def renamed_two(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-re params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "client": self._serialize.url("self._config.client", self._config.client, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -281,8 +281,8 @@ def renamed_four(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-r params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "client": self._serialize.url("self._config.client", self._config.client, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -326,8 +326,8 @@ def renamed_six(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-re params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "client": self._serialize.url("self._config.client", self._config.client, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) diff --git a/packages/typespec-python/test/azure/generated/client-structure-multiclient/client/structure/multiclient/aio/_client.py b/packages/typespec-python/test/azure/generated/client-structure-multiclient/client/structure/multiclient/aio/_client.py index c8d97f94dc7..def475d9b68 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-multiclient/client/structure/multiclient/aio/_client.py +++ b/packages/typespec-python/test/azure/generated/client-structure-multiclient/client/structure/multiclient/aio/_client.py @@ -76,8 +76,8 @@ def send_request( request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "client": self._serialize.url("self._config.client", self._config.client, "str"), } request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) @@ -156,8 +156,8 @@ def send_request( request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "client": self._serialize.url("self._config.client", self._config.client, "str"), } request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) diff --git a/packages/typespec-python/test/azure/generated/client-structure-multiclient/client/structure/multiclient/aio/_operations/_operations.py b/packages/typespec-python/test/azure/generated/client-structure-multiclient/client/structure/multiclient/aio/_operations/_operations.py index 92d427dba83..b7152985e76 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-multiclient/client/structure/multiclient/aio/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/client-structure-multiclient/client/structure/multiclient/aio/_operations/_operations.py @@ -61,8 +61,8 @@ async def renamed_one(self, **kwargs: Any) -> None: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "client": self._serialize.url("self._config.client", self._config.client, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -106,8 +106,8 @@ async def renamed_three(self, **kwargs: Any) -> None: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "client": self._serialize.url("self._config.client", self._config.client, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -151,8 +151,8 @@ async def renamed_five(self, **kwargs: Any) -> None: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "client": self._serialize.url("self._config.client", self._config.client, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -199,8 +199,8 @@ async def renamed_two(self, **kwargs: Any) -> None: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "client": self._serialize.url("self._config.client", self._config.client, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -244,8 +244,8 @@ async def renamed_four(self, **kwargs: Any) -> None: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "client": self._serialize.url("self._config.client", self._config.client, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -289,8 +289,8 @@ async def renamed_six(self, **kwargs: Any) -> None: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "client": self._serialize.url("self._config.client", self._config.client, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) diff --git a/packages/typespec-python/test/azure/generated/client-structure-renamedoperation/client/structure/renamedoperation/_client.py b/packages/typespec-python/test/azure/generated/client-structure-renamedoperation/client/structure/renamedoperation/_client.py index 4d899d81b1d..32757cbd18e 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-renamedoperation/client/structure/renamedoperation/_client.py +++ b/packages/typespec-python/test/azure/generated/client-structure-renamedoperation/client/structure/renamedoperation/_client.py @@ -79,8 +79,8 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "client": self._serialize.url("self._config.client", self._config.client, "str"), } request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) diff --git a/packages/typespec-python/test/azure/generated/client-structure-renamedoperation/client/structure/renamedoperation/aio/_client.py b/packages/typespec-python/test/azure/generated/client-structure-renamedoperation/client/structure/renamedoperation/aio/_client.py index 54d4845b128..b540f093447 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-renamedoperation/client/structure/renamedoperation/aio/_client.py +++ b/packages/typespec-python/test/azure/generated/client-structure-renamedoperation/client/structure/renamedoperation/aio/_client.py @@ -81,8 +81,8 @@ def send_request( request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "client": self._serialize.url("self._config.client", self._config.client, "str"), } request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) diff --git a/packages/typespec-python/test/azure/generated/client-structure-renamedoperation/client/structure/renamedoperation/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/client-structure-renamedoperation/client/structure/renamedoperation/aio/operations/_operations.py index 248ee3396f1..8d2439c6978 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-renamedoperation/client/structure/renamedoperation/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/client-structure-renamedoperation/client/structure/renamedoperation/aio/operations/_operations.py @@ -79,8 +79,8 @@ async def renamed_two(self, **kwargs: Any) -> None: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "client": self._serialize.url("self._config.client", self._config.client, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -124,8 +124,8 @@ async def renamed_four(self, **kwargs: Any) -> None: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "client": self._serialize.url("self._config.client", self._config.client, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -169,8 +169,8 @@ async def renamed_six(self, **kwargs: Any) -> None: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "client": self._serialize.url("self._config.client", self._config.client, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -217,8 +217,8 @@ async def renamed_one(self, **kwargs: Any) -> None: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "client": self._serialize.url("self._config.client", self._config.client, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -262,8 +262,8 @@ async def renamed_three(self, **kwargs: Any) -> None: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "client": self._serialize.url("self._config.client", self._config.client, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -307,8 +307,8 @@ async def renamed_five(self, **kwargs: Any) -> None: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "client": self._serialize.url("self._config.client", self._config.client, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) diff --git a/packages/typespec-python/test/azure/generated/client-structure-renamedoperation/client/structure/renamedoperation/operations/_operations.py b/packages/typespec-python/test/azure/generated/client-structure-renamedoperation/client/structure/renamedoperation/operations/_operations.py index b2b0c73e627..3fed9385f89 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-renamedoperation/client/structure/renamedoperation/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/client-structure-renamedoperation/client/structure/renamedoperation/operations/_operations.py @@ -115,8 +115,8 @@ def renamed_two(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-re params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "client": self._serialize.url("self._config.client", self._config.client, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -160,8 +160,8 @@ def renamed_four(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-r params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "client": self._serialize.url("self._config.client", self._config.client, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -205,8 +205,8 @@ def renamed_six(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-re params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "client": self._serialize.url("self._config.client", self._config.client, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -253,8 +253,8 @@ def renamed_one(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-re params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "client": self._serialize.url("self._config.client", self._config.client, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -298,8 +298,8 @@ def renamed_three(self, **kwargs: Any) -> None: # pylint: disable=inconsistent- params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "client": self._serialize.url("self._config.client", self._config.client, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -343,8 +343,8 @@ def renamed_five(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-r params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "client": self._serialize.url("self._config.client", self._config.client, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) diff --git a/packages/typespec-python/test/azure/generated/client-structure-twooperationgroup/client/structure/twooperationgroup/_client.py b/packages/typespec-python/test/azure/generated/client-structure-twooperationgroup/client/structure/twooperationgroup/_client.py index 84f5b6b086f..2468194ff3c 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-twooperationgroup/client/structure/twooperationgroup/_client.py +++ b/packages/typespec-python/test/azure/generated/client-structure-twooperationgroup/client/structure/twooperationgroup/_client.py @@ -80,8 +80,8 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "client": self._serialize.url("self._config.client", self._config.client, "str"), } request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) diff --git a/packages/typespec-python/test/azure/generated/client-structure-twooperationgroup/client/structure/twooperationgroup/aio/_client.py b/packages/typespec-python/test/azure/generated/client-structure-twooperationgroup/client/structure/twooperationgroup/aio/_client.py index 38f2b66bdcb..33ccce41114 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-twooperationgroup/client/structure/twooperationgroup/aio/_client.py +++ b/packages/typespec-python/test/azure/generated/client-structure-twooperationgroup/client/structure/twooperationgroup/aio/_client.py @@ -82,8 +82,8 @@ def send_request( request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "client": self._serialize.url("self._config.client", self._config.client, "str"), } request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) diff --git a/packages/typespec-python/test/azure/generated/client-structure-twooperationgroup/client/structure/twooperationgroup/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/client-structure-twooperationgroup/client/structure/twooperationgroup/aio/operations/_operations.py index 022c2d5182b..4bd2b3d186e 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-twooperationgroup/client/structure/twooperationgroup/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/client-structure-twooperationgroup/client/structure/twooperationgroup/aio/operations/_operations.py @@ -77,8 +77,8 @@ async def one(self, **kwargs: Any) -> None: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "client": self._serialize.url("self._config.client", self._config.client, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -122,8 +122,8 @@ async def three(self, **kwargs: Any) -> None: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "client": self._serialize.url("self._config.client", self._config.client, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -167,8 +167,8 @@ async def four(self, **kwargs: Any) -> None: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "client": self._serialize.url("self._config.client", self._config.client, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -230,8 +230,8 @@ async def two(self, **kwargs: Any) -> None: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "client": self._serialize.url("self._config.client", self._config.client, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -275,8 +275,8 @@ async def five(self, **kwargs: Any) -> None: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "client": self._serialize.url("self._config.client", self._config.client, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -320,8 +320,8 @@ async def six(self, **kwargs: Any) -> None: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "client": self._serialize.url("self._config.client", self._config.client, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) diff --git a/packages/typespec-python/test/azure/generated/client-structure-twooperationgroup/client/structure/twooperationgroup/operations/_operations.py b/packages/typespec-python/test/azure/generated/client-structure-twooperationgroup/client/structure/twooperationgroup/operations/_operations.py index 6b285d48b5c..ade65ee9f06 100644 --- a/packages/typespec-python/test/azure/generated/client-structure-twooperationgroup/client/structure/twooperationgroup/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/client-structure-twooperationgroup/client/structure/twooperationgroup/operations/_operations.py @@ -114,8 +114,8 @@ def one(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-sta params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "client": self._serialize.url("self._config.client", self._config.client, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -159,8 +159,8 @@ def three(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-s params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "client": self._serialize.url("self._config.client", self._config.client, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -204,8 +204,8 @@ def four(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-st params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "client": self._serialize.url("self._config.client", self._config.client, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -267,8 +267,8 @@ def two(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-sta params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "client": self._serialize.url("self._config.client", self._config.client, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -312,8 +312,8 @@ def five(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-st params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "client": self._serialize.url("self._config.client", self._config.client, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -357,8 +357,8 @@ def six(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-sta params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "client": self._serialize.url("self._config.client", self._config.client, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "client": self._serialize.url("self._config.client", self._config.client, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_client.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_client.py index 9dfb8f50961..fa40a38818d 100644 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_client.py +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_client.py @@ -82,16 +82,11 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), "serviceDeploymentVersion": self._serialize.url( - "self._config.service_deployment_version", - self._config.service_deployment_version, - "str", - skip_quote=True, - ), - "apiVersion": self._serialize.url( - "self._config.api_version", self._config.api_version, "str", skip_quote=True + "self._config.service_deployment_version", self._config.service_deployment_version, "str" ), + "apiVersion": self._serialize.url("self._config.api_version", self._config.api_version, "str"), } request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_operations/_operations.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_operations/_operations.py index afbbd99f809..22876d36a34 100644 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_operations/_operations.py @@ -96,16 +96,11 @@ def from_none(self, **kwargs: Any) -> bool: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), "serviceDeploymentVersion": self._serialize.url( - "self._config.service_deployment_version", - self._config.service_deployment_version, - "str", - skip_quote=True, - ), - "apiVersion": self._serialize.url( - "self._config.api_version", self._config.api_version, "str", skip_quote=True + "self._config.service_deployment_version", self._config.service_deployment_version, "str" ), + "apiVersion": self._serialize.url("self._config.api_version", self._config.api_version, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -156,16 +151,11 @@ def from_one_required( # pylint: disable=inconsistent-return-statements params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), "serviceDeploymentVersion": self._serialize.url( - "self._config.service_deployment_version", - self._config.service_deployment_version, - "str", - skip_quote=True, - ), - "apiVersion": self._serialize.url( - "self._config.api_version", self._config.api_version, "str", skip_quote=True + "self._config.service_deployment_version", self._config.service_deployment_version, "str" ), + "apiVersion": self._serialize.url("self._config.api_version", self._config.api_version, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -215,16 +205,11 @@ def from_one_optional( # pylint: disable=inconsistent-return-statements params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), "serviceDeploymentVersion": self._serialize.url( - "self._config.service_deployment_version", - self._config.service_deployment_version, - "str", - skip_quote=True, - ), - "apiVersion": self._serialize.url( - "self._config.api_version", self._config.api_version, "str", skip_quote=True + "self._config.service_deployment_version", self._config.service_deployment_version, "str" ), + "apiVersion": self._serialize.url("self._config.api_version", self._config.api_version, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/aio/_client.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/aio/_client.py index 919a83a2aed..6e5d7d32e1a 100644 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/aio/_client.py +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/aio/_client.py @@ -84,16 +84,11 @@ def send_request( request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), "serviceDeploymentVersion": self._serialize.url( - "self._config.service_deployment_version", - self._config.service_deployment_version, - "str", - skip_quote=True, - ), - "apiVersion": self._serialize.url( - "self._config.api_version", self._config.api_version, "str", skip_quote=True + "self._config.service_deployment_version", self._config.service_deployment_version, "str" ), + "apiVersion": self._serialize.url("self._config.api_version", self._config.api_version, "str"), } request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/aio/_operations/_operations.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/aio/_operations/_operations.py index 8eabf7cf3d7..b73e81158c7 100644 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/aio/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/aio/_operations/_operations.py @@ -61,16 +61,11 @@ async def from_none(self, **kwargs: Any) -> bool: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), "serviceDeploymentVersion": self._serialize.url( - "self._config.service_deployment_version", - self._config.service_deployment_version, - "str", - skip_quote=True, - ), - "apiVersion": self._serialize.url( - "self._config.api_version", self._config.api_version, "str", skip_quote=True + "self._config.service_deployment_version", self._config.service_deployment_version, "str" ), + "apiVersion": self._serialize.url("self._config.api_version", self._config.api_version, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -119,16 +114,11 @@ async def from_one_required(self, *, parameter: str, **kwargs: Any) -> None: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), "serviceDeploymentVersion": self._serialize.url( - "self._config.service_deployment_version", - self._config.service_deployment_version, - "str", - skip_quote=True, - ), - "apiVersion": self._serialize.url( - "self._config.api_version", self._config.api_version, "str", skip_quote=True + "self._config.service_deployment_version", self._config.service_deployment_version, "str" ), + "apiVersion": self._serialize.url("self._config.api_version", self._config.api_version, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -176,16 +166,11 @@ async def from_one_optional(self, *, parameter: Optional[str] = None, **kwargs: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), "serviceDeploymentVersion": self._serialize.url( - "self._config.service_deployment_version", - self._config.service_deployment_version, - "str", - skip_quote=True, - ), - "apiVersion": self._serialize.url( - "self._config.api_version", self._config.api_version, "str", skip_quote=True + "self._config.service_deployment_version", self._config.service_deployment_version, "str" ), + "apiVersion": self._serialize.url("self._config.api_version", self._config.api_version, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_client.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_client.py index c1a31fdd1e2..7000678cf9f 100644 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_client.py +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_client.py @@ -99,16 +99,11 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), "serviceDeploymentVersion": self._serialize.url( - "self._config.service_deployment_version", - self._config.service_deployment_version, - "str", - skip_quote=True, - ), - "apiVersion": self._serialize.url( - "self._config.api_version", self._config.api_version, "str", skip_quote=True + "self._config.service_deployment_version", self._config.service_deployment_version, "str" ), + "apiVersion": self._serialize.url("self._config.api_version", self._config.api_version, "str"), } request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_operations/_operations.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_operations/_operations.py index 806622bbb93..0e5b9651387 100644 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_operations/_operations.py @@ -120,16 +120,11 @@ def add_operation(self, **kwargs: Any) -> None: # pylint: disable=inconsistent- params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), "serviceDeploymentVersion": self._serialize.url( - "self._config.service_deployment_version", - self._config.service_deployment_version, - "str", - skip_quote=True, - ), - "apiVersion": self._serialize.url( - "self._config.api_version", self._config.api_version, "str", skip_quote=True + "self._config.service_deployment_version", self._config.service_deployment_version, "str" ), + "apiVersion": self._serialize.url("self._config.api_version", self._config.api_version, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -179,16 +174,11 @@ def from_none(self, *, new_parameter: Optional[str] = None, **kwargs: Any) -> bo params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), "serviceDeploymentVersion": self._serialize.url( - "self._config.service_deployment_version", - self._config.service_deployment_version, - "str", - skip_quote=True, - ), - "apiVersion": self._serialize.url( - "self._config.api_version", self._config.api_version, "str", skip_quote=True + "self._config.service_deployment_version", self._config.service_deployment_version, "str" ), + "apiVersion": self._serialize.url("self._config.api_version", self._config.api_version, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -245,16 +235,11 @@ def from_one_required( # pylint: disable=inconsistent-return-statements params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), "serviceDeploymentVersion": self._serialize.url( - "self._config.service_deployment_version", - self._config.service_deployment_version, - "str", - skip_quote=True, - ), - "apiVersion": self._serialize.url( - "self._config.api_version", self._config.api_version, "str", skip_quote=True + "self._config.service_deployment_version", self._config.service_deployment_version, "str" ), + "apiVersion": self._serialize.url("self._config.api_version", self._config.api_version, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -310,16 +295,11 @@ def from_one_optional( # pylint: disable=inconsistent-return-statements params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), "serviceDeploymentVersion": self._serialize.url( - "self._config.service_deployment_version", - self._config.service_deployment_version, - "str", - skip_quote=True, - ), - "apiVersion": self._serialize.url( - "self._config.api_version", self._config.api_version, "str", skip_quote=True + "self._config.service_deployment_version", self._config.service_deployment_version, "str" ), + "apiVersion": self._serialize.url("self._config.api_version", self._config.api_version, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/aio/_client.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/aio/_client.py index c12f0bbdfa5..1f90d8deab5 100644 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/aio/_client.py +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/aio/_client.py @@ -101,16 +101,11 @@ def send_request( request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), "serviceDeploymentVersion": self._serialize.url( - "self._config.service_deployment_version", - self._config.service_deployment_version, - "str", - skip_quote=True, - ), - "apiVersion": self._serialize.url( - "self._config.api_version", self._config.api_version, "str", skip_quote=True + "self._config.service_deployment_version", self._config.service_deployment_version, "str" ), + "apiVersion": self._serialize.url("self._config.api_version", self._config.api_version, "str"), } request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/aio/_operations/_operations.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/aio/_operations/_operations.py index 6c49b95bc1a..97493602f33 100644 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/aio/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/aio/_operations/_operations.py @@ -65,16 +65,11 @@ async def add_operation(self, **kwargs: Any) -> None: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), "serviceDeploymentVersion": self._serialize.url( - "self._config.service_deployment_version", - self._config.service_deployment_version, - "str", - skip_quote=True, - ), - "apiVersion": self._serialize.url( - "self._config.api_version", self._config.api_version, "str", skip_quote=True + "self._config.service_deployment_version", self._config.service_deployment_version, "str" ), + "apiVersion": self._serialize.url("self._config.api_version", self._config.api_version, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -124,16 +119,11 @@ async def from_none(self, *, new_parameter: Optional[str] = None, **kwargs: Any) params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), "serviceDeploymentVersion": self._serialize.url( - "self._config.service_deployment_version", - self._config.service_deployment_version, - "str", - skip_quote=True, - ), - "apiVersion": self._serialize.url( - "self._config.api_version", self._config.api_version, "str", skip_quote=True + "self._config.service_deployment_version", self._config.service_deployment_version, "str" ), + "apiVersion": self._serialize.url("self._config.api_version", self._config.api_version, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -188,16 +178,11 @@ async def from_one_required(self, *, parameter: str, new_parameter: Optional[str params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), "serviceDeploymentVersion": self._serialize.url( - "self._config.service_deployment_version", - self._config.service_deployment_version, - "str", - skip_quote=True, - ), - "apiVersion": self._serialize.url( - "self._config.api_version", self._config.api_version, "str", skip_quote=True + "self._config.service_deployment_version", self._config.service_deployment_version, "str" ), + "apiVersion": self._serialize.url("self._config.api_version", self._config.api_version, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -253,16 +238,11 @@ async def from_one_optional( params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), "serviceDeploymentVersion": self._serialize.url( - "self._config.service_deployment_version", - self._config.service_deployment_version, - "str", - skip_quote=True, - ), - "apiVersion": self._serialize.url( - "self._config.api_version", self._config.api_version, "str", skip_quote=True + "self._config.service_deployment_version", self._config.service_deployment_version, "str" ), + "apiVersion": self._serialize.url("self._config.api_version", self._config.api_version, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) diff --git a/packages/typespec-python/test/azure/generated/server-path-multiple/server/path/multiple/_client.py b/packages/typespec-python/test/azure/generated/server-path-multiple/server/path/multiple/_client.py index c8cd0204d31..d18ce37d99f 100644 --- a/packages/typespec-python/test/azure/generated/server-path-multiple/server/path/multiple/_client.py +++ b/packages/typespec-python/test/azure/generated/server-path-multiple/server/path/multiple/_client.py @@ -72,10 +72,8 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "apiVersion": self._serialize.url( - "self._config.api_version", self._config.api_version, "str", skip_quote=True - ), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "apiVersion": self._serialize.url("self._config.api_version", self._config.api_version, "str"), } request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) diff --git a/packages/typespec-python/test/azure/generated/server-path-multiple/server/path/multiple/_operations/_operations.py b/packages/typespec-python/test/azure/generated/server-path-multiple/server/path/multiple/_operations/_operations.py index ed50296fd85..594b0447e5c 100644 --- a/packages/typespec-python/test/azure/generated/server-path-multiple/server/path/multiple/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/server-path-multiple/server/path/multiple/_operations/_operations.py @@ -77,10 +77,8 @@ def no_operation_params(self, **kwargs: Any) -> None: # pylint: disable=inconsi params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "apiVersion": self._serialize.url( - "self._config.api_version", self._config.api_version, "str", skip_quote=True - ), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "apiVersion": self._serialize.url("self._config.api_version", self._config.api_version, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -129,10 +127,8 @@ def with_operation_path_param( # pylint: disable=inconsistent-return-statements params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "apiVersion": self._serialize.url( - "self._config.api_version", self._config.api_version, "str", skip_quote=True - ), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "apiVersion": self._serialize.url("self._config.api_version", self._config.api_version, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) diff --git a/packages/typespec-python/test/azure/generated/server-path-multiple/server/path/multiple/aio/_client.py b/packages/typespec-python/test/azure/generated/server-path-multiple/server/path/multiple/aio/_client.py index 05d592e45cc..53fba881aa4 100644 --- a/packages/typespec-python/test/azure/generated/server-path-multiple/server/path/multiple/aio/_client.py +++ b/packages/typespec-python/test/azure/generated/server-path-multiple/server/path/multiple/aio/_client.py @@ -74,10 +74,8 @@ def send_request( request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "apiVersion": self._serialize.url( - "self._config.api_version", self._config.api_version, "str", skip_quote=True - ), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "apiVersion": self._serialize.url("self._config.api_version", self._config.api_version, "str"), } request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) diff --git a/packages/typespec-python/test/azure/generated/server-path-multiple/server/path/multiple/aio/_operations/_operations.py b/packages/typespec-python/test/azure/generated/server-path-multiple/server/path/multiple/aio/_operations/_operations.py index b5f838eeae1..207badc0ab9 100644 --- a/packages/typespec-python/test/azure/generated/server-path-multiple/server/path/multiple/aio/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/server-path-multiple/server/path/multiple/aio/_operations/_operations.py @@ -57,10 +57,8 @@ async def no_operation_params(self, **kwargs: Any) -> None: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "apiVersion": self._serialize.url( - "self._config.api_version", self._config.api_version, "str", skip_quote=True - ), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "apiVersion": self._serialize.url("self._config.api_version", self._config.api_version, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -107,10 +105,8 @@ async def with_operation_path_param(self, keyword: str, **kwargs: Any) -> None: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "apiVersion": self._serialize.url( - "self._config.api_version", self._config.api_version, "str", skip_quote=True - ), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "apiVersion": self._serialize.url("self._config.api_version", self._config.api_version, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) diff --git a/packages/typespec-python/test/azure/generated/server-path-single/server/path/single/_client.py b/packages/typespec-python/test/azure/generated/server-path-single/server/path/single/_client.py index 365941ca72d..6892c9a662a 100644 --- a/packages/typespec-python/test/azure/generated/server-path-single/server/path/single/_client.py +++ b/packages/typespec-python/test/azure/generated/server-path-single/server/path/single/_client.py @@ -69,7 +69,7 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), + "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) diff --git a/packages/typespec-python/test/azure/generated/server-path-single/server/path/single/_operations/_operations.py b/packages/typespec-python/test/azure/generated/server-path-single/server/path/single/_operations/_operations.py index 48ece05c1b3..8745de9c5ae 100644 --- a/packages/typespec-python/test/azure/generated/server-path-single/server/path/single/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/server-path-single/server/path/single/_operations/_operations.py @@ -63,7 +63,7 @@ def my_op(self, **kwargs: Any) -> bool: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), + "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) diff --git a/packages/typespec-python/test/azure/generated/server-path-single/server/path/single/aio/_client.py b/packages/typespec-python/test/azure/generated/server-path-single/server/path/single/aio/_client.py index f579824eda2..3fcfcf0f7c7 100644 --- a/packages/typespec-python/test/azure/generated/server-path-single/server/path/single/aio/_client.py +++ b/packages/typespec-python/test/azure/generated/server-path-single/server/path/single/aio/_client.py @@ -71,7 +71,7 @@ def send_request( request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), + "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) diff --git a/packages/typespec-python/test/azure/generated/server-path-single/server/path/single/aio/_operations/_operations.py b/packages/typespec-python/test/azure/generated/server-path-single/server/path/single/aio/_operations/_operations.py index 58e0ac472f9..a4fcb3cb3be 100644 --- a/packages/typespec-python/test/azure/generated/server-path-single/server/path/single/aio/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/server-path-single/server/path/single/aio/_operations/_operations.py @@ -54,7 +54,7 @@ async def my_op(self, **kwargs: Any) -> bool: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), + "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) diff --git a/packages/typespec-python/test/azure/generated/server-versions-not-versioned/server/versions/notversioned/_client.py b/packages/typespec-python/test/azure/generated/server-versions-not-versioned/server/versions/notversioned/_client.py index 36704878d9a..b281edd7417 100644 --- a/packages/typespec-python/test/azure/generated/server-versions-not-versioned/server/versions/notversioned/_client.py +++ b/packages/typespec-python/test/azure/generated/server-versions-not-versioned/server/versions/notversioned/_client.py @@ -69,7 +69,7 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), + "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) diff --git a/packages/typespec-python/test/azure/generated/server-versions-not-versioned/server/versions/notversioned/_operations/_operations.py b/packages/typespec-python/test/azure/generated/server-versions-not-versioned/server/versions/notversioned/_operations/_operations.py index bcc61140f1e..dcd2cec01a7 100644 --- a/packages/typespec-python/test/azure/generated/server-versions-not-versioned/server/versions/notversioned/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/server-versions-not-versioned/server/versions/notversioned/_operations/_operations.py @@ -92,7 +92,7 @@ def without_api_version(self, **kwargs: Any) -> bool: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), + "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) @@ -140,7 +140,7 @@ def with_query_api_version(self, *, api_version: str, **kwargs: Any) -> bool: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), + "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) @@ -188,7 +188,7 @@ def with_path_api_version(self, api_version: str, **kwargs: Any) -> bool: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), + "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) diff --git a/packages/typespec-python/test/azure/generated/server-versions-not-versioned/server/versions/notversioned/aio/_client.py b/packages/typespec-python/test/azure/generated/server-versions-not-versioned/server/versions/notversioned/aio/_client.py index 1d58ee2933d..9854de87979 100644 --- a/packages/typespec-python/test/azure/generated/server-versions-not-versioned/server/versions/notversioned/aio/_client.py +++ b/packages/typespec-python/test/azure/generated/server-versions-not-versioned/server/versions/notversioned/aio/_client.py @@ -71,7 +71,7 @@ def send_request( request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), + "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) diff --git a/packages/typespec-python/test/azure/generated/server-versions-not-versioned/server/versions/notversioned/aio/_operations/_operations.py b/packages/typespec-python/test/azure/generated/server-versions-not-versioned/server/versions/notversioned/aio/_operations/_operations.py index f1cd973a764..a819009c4e5 100644 --- a/packages/typespec-python/test/azure/generated/server-versions-not-versioned/server/versions/notversioned/aio/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/server-versions-not-versioned/server/versions/notversioned/aio/_operations/_operations.py @@ -58,7 +58,7 @@ async def without_api_version(self, **kwargs: Any) -> bool: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), + "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) @@ -106,7 +106,7 @@ async def with_query_api_version(self, *, api_version: str, **kwargs: Any) -> bo params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), + "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) @@ -154,7 +154,7 @@ async def with_path_api_version(self, api_version: str, **kwargs: Any) -> bool: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), + "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) diff --git a/packages/typespec-python/test/azure/generated/server-versions-versioned/server/versions/versioned/_client.py b/packages/typespec-python/test/azure/generated/server-versions-versioned/server/versions/versioned/_client.py index 4665695131e..391f606b150 100644 --- a/packages/typespec-python/test/azure/generated/server-versions-versioned/server/versions/versioned/_client.py +++ b/packages/typespec-python/test/azure/generated/server-versions-versioned/server/versions/versioned/_client.py @@ -72,7 +72,7 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), + "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) diff --git a/packages/typespec-python/test/azure/generated/server-versions-versioned/server/versions/versioned/_operations/_operations.py b/packages/typespec-python/test/azure/generated/server-versions-versioned/server/versions/versioned/_operations/_operations.py index 6d5055139c6..8e249e2cad7 100644 --- a/packages/typespec-python/test/azure/generated/server-versions-versioned/server/versions/versioned/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/server-versions-versioned/server/versions/versioned/_operations/_operations.py @@ -103,7 +103,7 @@ def without_api_version(self, **kwargs: Any) -> bool: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), + "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) @@ -149,7 +149,7 @@ def with_query_api_version(self, **kwargs: Any) -> bool: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), + "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) @@ -195,7 +195,7 @@ def with_path_api_version(self, **kwargs: Any) -> bool: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), + "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) @@ -241,7 +241,7 @@ def with_query_old_api_version(self, **kwargs: Any) -> bool: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), + "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) diff --git a/packages/typespec-python/test/azure/generated/server-versions-versioned/server/versions/versioned/aio/_client.py b/packages/typespec-python/test/azure/generated/server-versions-versioned/server/versions/versioned/aio/_client.py index f2a900df25a..9d2b09d077a 100644 --- a/packages/typespec-python/test/azure/generated/server-versions-versioned/server/versions/versioned/aio/_client.py +++ b/packages/typespec-python/test/azure/generated/server-versions-versioned/server/versions/versioned/aio/_client.py @@ -74,7 +74,7 @@ def send_request( request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), + "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) diff --git a/packages/typespec-python/test/azure/generated/server-versions-versioned/server/versions/versioned/aio/_operations/_operations.py b/packages/typespec-python/test/azure/generated/server-versions-versioned/server/versions/versioned/aio/_operations/_operations.py index 70bc034b288..9c169cc2b33 100644 --- a/packages/typespec-python/test/azure/generated/server-versions-versioned/server/versions/versioned/aio/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/server-versions-versioned/server/versions/versioned/aio/_operations/_operations.py @@ -59,7 +59,7 @@ async def without_api_version(self, **kwargs: Any) -> bool: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), + "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) @@ -105,7 +105,7 @@ async def with_query_api_version(self, **kwargs: Any) -> bool: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), + "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) @@ -151,7 +151,7 @@ async def with_path_api_version(self, **kwargs: Any) -> bool: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), + "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) @@ -197,7 +197,7 @@ async def with_query_old_api_version(self, **kwargs: Any) -> bool: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), + "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) diff --git a/packages/typespec-python/test/azure/generated/versioning-added/versioning/added/_client.py b/packages/typespec-python/test/azure/generated/versioning-added/versioning/added/_client.py index 67c0491875a..8f6197dae2b 100644 --- a/packages/typespec-python/test/azure/generated/versioning-added/versioning/added/_client.py +++ b/packages/typespec-python/test/azure/generated/versioning-added/versioning/added/_client.py @@ -76,8 +76,8 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "version": self._serialize.url("self._config.version", self._config.version, "str"), } request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) diff --git a/packages/typespec-python/test/azure/generated/versioning-added/versioning/added/aio/_client.py b/packages/typespec-python/test/azure/generated/versioning-added/versioning/added/aio/_client.py index b501d5f0315..ae3633d4e5e 100644 --- a/packages/typespec-python/test/azure/generated/versioning-added/versioning/added/aio/_client.py +++ b/packages/typespec-python/test/azure/generated/versioning-added/versioning/added/aio/_client.py @@ -78,8 +78,8 @@ def send_request( request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "version": self._serialize.url("self._config.version", self._config.version, "str"), } request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) diff --git a/packages/typespec-python/test/azure/generated/versioning-added/versioning/added/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/versioning-added/versioning/added/aio/operations/_operations.py index c290b40239a..137b5a0c893 100644 --- a/packages/typespec-python/test/azure/generated/versioning-added/versioning/added/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/versioning-added/versioning/added/aio/operations/_operations.py @@ -149,8 +149,8 @@ async def v2_in_interface(self, body: Union[_models.ModelV2, JSON, IO[bytes]], * params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "version": self._serialize.url("self._config.version", self._config.version, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -283,8 +283,8 @@ async def v1( params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "version": self._serialize.url("self._config.version", self._config.version, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -400,8 +400,8 @@ async def v2(self, body: Union[_models.ModelV2, JSON, IO[bytes]], **kwargs: Any) params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "version": self._serialize.url("self._config.version", self._config.version, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) diff --git a/packages/typespec-python/test/azure/generated/versioning-added/versioning/added/operations/_operations.py b/packages/typespec-python/test/azure/generated/versioning-added/versioning/added/operations/_operations.py index 9dd37a4da3b..bc80ab059a4 100644 --- a/packages/typespec-python/test/azure/generated/versioning-added/versioning/added/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/versioning-added/versioning/added/operations/_operations.py @@ -196,8 +196,8 @@ def v2_in_interface(self, body: Union[_models.ModelV2, JSON, IO[bytes]], **kwarg params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "version": self._serialize.url("self._config.version", self._config.version, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -328,8 +328,8 @@ def v1(self, body: Union[_models.ModelV1, JSON, IO[bytes]], *, header_v2: str, * params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "version": self._serialize.url("self._config.version", self._config.version, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -443,8 +443,8 @@ def v2(self, body: Union[_models.ModelV2, JSON, IO[bytes]], **kwargs: Any) -> _m params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "version": self._serialize.url("self._config.version", self._config.version, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) diff --git a/packages/typespec-python/test/azure/generated/versioning-madeoptional/versioning/madeoptional/_client.py b/packages/typespec-python/test/azure/generated/versioning-madeoptional/versioning/madeoptional/_client.py index 03ba49f9b02..fa96d674a38 100644 --- a/packages/typespec-python/test/azure/generated/versioning-madeoptional/versioning/madeoptional/_client.py +++ b/packages/typespec-python/test/azure/generated/versioning-madeoptional/versioning/madeoptional/_client.py @@ -73,8 +73,8 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "version": self._serialize.url("self._config.version", self._config.version, "str"), } request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) diff --git a/packages/typespec-python/test/azure/generated/versioning-madeoptional/versioning/madeoptional/_operations/_operations.py b/packages/typespec-python/test/azure/generated/versioning-madeoptional/versioning/madeoptional/_operations/_operations.py index c3937af67ee..487a36cea13 100644 --- a/packages/typespec-python/test/azure/generated/versioning-madeoptional/versioning/madeoptional/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/versioning-madeoptional/versioning/madeoptional/_operations/_operations.py @@ -162,8 +162,8 @@ def test( params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "version": self._serialize.url("self._config.version", self._config.version, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) diff --git a/packages/typespec-python/test/azure/generated/versioning-madeoptional/versioning/madeoptional/aio/_client.py b/packages/typespec-python/test/azure/generated/versioning-madeoptional/versioning/madeoptional/aio/_client.py index 19075d10b0b..214ae95c230 100644 --- a/packages/typespec-python/test/azure/generated/versioning-madeoptional/versioning/madeoptional/aio/_client.py +++ b/packages/typespec-python/test/azure/generated/versioning-madeoptional/versioning/madeoptional/aio/_client.py @@ -75,8 +75,8 @@ def send_request( request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "version": self._serialize.url("self._config.version", self._config.version, "str"), } request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) diff --git a/packages/typespec-python/test/azure/generated/versioning-madeoptional/versioning/madeoptional/aio/_operations/_operations.py b/packages/typespec-python/test/azure/generated/versioning-madeoptional/versioning/madeoptional/aio/_operations/_operations.py index 63ffc828d74..17d58762f36 100644 --- a/packages/typespec-python/test/azure/generated/versioning-madeoptional/versioning/madeoptional/aio/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/versioning-madeoptional/versioning/madeoptional/aio/_operations/_operations.py @@ -138,8 +138,8 @@ async def test( params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "version": self._serialize.url("self._config.version", self._config.version, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) diff --git a/packages/typespec-python/test/azure/generated/versioning-removed/versioning/removed/_client.py b/packages/typespec-python/test/azure/generated/versioning-removed/versioning/removed/_client.py index 87ee6a67e07..a415a213d46 100644 --- a/packages/typespec-python/test/azure/generated/versioning-removed/versioning/removed/_client.py +++ b/packages/typespec-python/test/azure/generated/versioning-removed/versioning/removed/_client.py @@ -73,8 +73,8 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "version": self._serialize.url("self._config.version", self._config.version, "str"), } request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) diff --git a/packages/typespec-python/test/azure/generated/versioning-removed/versioning/removed/_operations/_operations.py b/packages/typespec-python/test/azure/generated/versioning-removed/versioning/removed/_operations/_operations.py index 1d01ba1a108..4fa2f874597 100644 --- a/packages/typespec-python/test/azure/generated/versioning-removed/versioning/removed/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/versioning-removed/versioning/removed/_operations/_operations.py @@ -152,8 +152,8 @@ def v2(self, body: Union[_models.ModelV2, JSON, IO[bytes]], **kwargs: Any) -> _m params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "version": self._serialize.url("self._config.version", self._config.version, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -269,8 +269,8 @@ def model_v3(self, body: Union[_models.ModelV3, JSON, IO[bytes]], **kwargs: Any) params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "version": self._serialize.url("self._config.version", self._config.version, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) diff --git a/packages/typespec-python/test/azure/generated/versioning-removed/versioning/removed/aio/_client.py b/packages/typespec-python/test/azure/generated/versioning-removed/versioning/removed/aio/_client.py index 6859849b3e8..5ef4e468fa9 100644 --- a/packages/typespec-python/test/azure/generated/versioning-removed/versioning/removed/aio/_client.py +++ b/packages/typespec-python/test/azure/generated/versioning-removed/versioning/removed/aio/_client.py @@ -75,8 +75,8 @@ def send_request( request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "version": self._serialize.url("self._config.version", self._config.version, "str"), } request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) diff --git a/packages/typespec-python/test/azure/generated/versioning-removed/versioning/removed/aio/_operations/_operations.py b/packages/typespec-python/test/azure/generated/versioning-removed/versioning/removed/aio/_operations/_operations.py index 28dd171ad5a..e8bd0595d8b 100644 --- a/packages/typespec-python/test/azure/generated/versioning-removed/versioning/removed/aio/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/versioning-removed/versioning/removed/aio/_operations/_operations.py @@ -118,8 +118,8 @@ async def v2(self, body: Union[_models.ModelV2, JSON, IO[bytes]], **kwargs: Any) params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "version": self._serialize.url("self._config.version", self._config.version, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -237,8 +237,8 @@ async def model_v3(self, body: Union[_models.ModelV3, JSON, IO[bytes]], **kwargs params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "version": self._serialize.url("self._config.version", self._config.version, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) diff --git a/packages/typespec-python/test/azure/generated/versioning-renamedfrom/versioning/renamedfrom/_client.py b/packages/typespec-python/test/azure/generated/versioning-renamedfrom/versioning/renamedfrom/_client.py index fff7ebcfa17..f5c5981e76b 100644 --- a/packages/typespec-python/test/azure/generated/versioning-renamedfrom/versioning/renamedfrom/_client.py +++ b/packages/typespec-python/test/azure/generated/versioning-renamedfrom/versioning/renamedfrom/_client.py @@ -76,8 +76,8 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "version": self._serialize.url("self._config.version", self._config.version, "str"), } request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) diff --git a/packages/typespec-python/test/azure/generated/versioning-renamedfrom/versioning/renamedfrom/aio/_client.py b/packages/typespec-python/test/azure/generated/versioning-renamedfrom/versioning/renamedfrom/aio/_client.py index df806dee9c1..c7232df7ba8 100644 --- a/packages/typespec-python/test/azure/generated/versioning-renamedfrom/versioning/renamedfrom/aio/_client.py +++ b/packages/typespec-python/test/azure/generated/versioning-renamedfrom/versioning/renamedfrom/aio/_client.py @@ -78,8 +78,8 @@ def send_request( request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "version": self._serialize.url("self._config.version", self._config.version, "str"), } request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) diff --git a/packages/typespec-python/test/azure/generated/versioning-renamedfrom/versioning/renamedfrom/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/versioning-renamedfrom/versioning/renamedfrom/aio/operations/_operations.py index 3ec20a4e6a7..0f0ac531660 100644 --- a/packages/typespec-python/test/azure/generated/versioning-renamedfrom/versioning/renamedfrom/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/versioning-renamedfrom/versioning/renamedfrom/aio/operations/_operations.py @@ -145,8 +145,8 @@ async def new_op_in_new_interface( params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "version": self._serialize.url("self._config.version", self._config.version, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -276,8 +276,8 @@ async def new_op( params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "version": self._serialize.url("self._config.version", self._config.version, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) diff --git a/packages/typespec-python/test/azure/generated/versioning-renamedfrom/versioning/renamedfrom/operations/_operations.py b/packages/typespec-python/test/azure/generated/versioning-renamedfrom/versioning/renamedfrom/operations/_operations.py index d9c0e9b7a0c..c7314c6aa55 100644 --- a/packages/typespec-python/test/azure/generated/versioning-renamedfrom/versioning/renamedfrom/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/versioning-renamedfrom/versioning/renamedfrom/operations/_operations.py @@ -181,8 +181,8 @@ def new_op_in_new_interface( params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "version": self._serialize.url("self._config.version", self._config.version, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -312,8 +312,8 @@ def new_op( params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "version": self._serialize.url("self._config.version", self._config.version, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) diff --git a/packages/typespec-python/test/azure/generated/versioning-returntypechangedfrom/versioning/returntypechangedfrom/_client.py b/packages/typespec-python/test/azure/generated/versioning-returntypechangedfrom/versioning/returntypechangedfrom/_client.py index b4b0b372342..6a6b5ea1f1a 100644 --- a/packages/typespec-python/test/azure/generated/versioning-returntypechangedfrom/versioning/returntypechangedfrom/_client.py +++ b/packages/typespec-python/test/azure/generated/versioning-returntypechangedfrom/versioning/returntypechangedfrom/_client.py @@ -75,8 +75,8 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "version": self._serialize.url("self._config.version", self._config.version, "str"), } request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) diff --git a/packages/typespec-python/test/azure/generated/versioning-returntypechangedfrom/versioning/returntypechangedfrom/_operations/_operations.py b/packages/typespec-python/test/azure/generated/versioning-returntypechangedfrom/versioning/returntypechangedfrom/_operations/_operations.py index f4051a07a81..c594717b672 100644 --- a/packages/typespec-python/test/azure/generated/versioning-returntypechangedfrom/versioning/returntypechangedfrom/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/versioning-returntypechangedfrom/versioning/returntypechangedfrom/_operations/_operations.py @@ -84,8 +84,8 @@ def test(self, body: str, **kwargs: Any) -> str: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "version": self._serialize.url("self._config.version", self._config.version, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) diff --git a/packages/typespec-python/test/azure/generated/versioning-returntypechangedfrom/versioning/returntypechangedfrom/aio/_client.py b/packages/typespec-python/test/azure/generated/versioning-returntypechangedfrom/versioning/returntypechangedfrom/aio/_client.py index 17c1c60ed6a..e82d76189af 100644 --- a/packages/typespec-python/test/azure/generated/versioning-returntypechangedfrom/versioning/returntypechangedfrom/aio/_client.py +++ b/packages/typespec-python/test/azure/generated/versioning-returntypechangedfrom/versioning/returntypechangedfrom/aio/_client.py @@ -77,8 +77,8 @@ def send_request( request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "version": self._serialize.url("self._config.version", self._config.version, "str"), } request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) diff --git a/packages/typespec-python/test/azure/generated/versioning-returntypechangedfrom/versioning/returntypechangedfrom/aio/_operations/_operations.py b/packages/typespec-python/test/azure/generated/versioning-returntypechangedfrom/versioning/returntypechangedfrom/aio/_operations/_operations.py index a3aaf504c08..6355566155e 100644 --- a/packages/typespec-python/test/azure/generated/versioning-returntypechangedfrom/versioning/returntypechangedfrom/aio/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/versioning-returntypechangedfrom/versioning/returntypechangedfrom/aio/_operations/_operations.py @@ -66,8 +66,8 @@ async def test(self, body: str, **kwargs: Any) -> str: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "version": self._serialize.url("self._config.version", self._config.version, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) diff --git a/packages/typespec-python/test/azure/generated/versioning-typechangedfrom/versioning/typechangedfrom/_client.py b/packages/typespec-python/test/azure/generated/versioning-typechangedfrom/versioning/typechangedfrom/_client.py index 2bef9bf7dce..ea5a36bba68 100644 --- a/packages/typespec-python/test/azure/generated/versioning-typechangedfrom/versioning/typechangedfrom/_client.py +++ b/packages/typespec-python/test/azure/generated/versioning-typechangedfrom/versioning/typechangedfrom/_client.py @@ -73,8 +73,8 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "version": self._serialize.url("self._config.version", self._config.version, "str"), } request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) diff --git a/packages/typespec-python/test/azure/generated/versioning-typechangedfrom/versioning/typechangedfrom/_operations/_operations.py b/packages/typespec-python/test/azure/generated/versioning-typechangedfrom/versioning/typechangedfrom/_operations/_operations.py index ea3612cda5b..a50269853c8 100644 --- a/packages/typespec-python/test/azure/generated/versioning-typechangedfrom/versioning/typechangedfrom/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/versioning-typechangedfrom/versioning/typechangedfrom/_operations/_operations.py @@ -154,8 +154,8 @@ def test(self, body: Union[_models.TestModel, JSON, IO[bytes]], *, param: str, * params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "version": self._serialize.url("self._config.version", self._config.version, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) diff --git a/packages/typespec-python/test/azure/generated/versioning-typechangedfrom/versioning/typechangedfrom/aio/_client.py b/packages/typespec-python/test/azure/generated/versioning-typechangedfrom/versioning/typechangedfrom/aio/_client.py index 470ba4968b1..781b681abe1 100644 --- a/packages/typespec-python/test/azure/generated/versioning-typechangedfrom/versioning/typechangedfrom/aio/_client.py +++ b/packages/typespec-python/test/azure/generated/versioning-typechangedfrom/versioning/typechangedfrom/aio/_client.py @@ -75,8 +75,8 @@ def send_request( request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "version": self._serialize.url("self._config.version", self._config.version, "str"), } request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) diff --git a/packages/typespec-python/test/azure/generated/versioning-typechangedfrom/versioning/typechangedfrom/aio/_operations/_operations.py b/packages/typespec-python/test/azure/generated/versioning-typechangedfrom/versioning/typechangedfrom/aio/_operations/_operations.py index 148c6279839..44d40ed7ae0 100644 --- a/packages/typespec-python/test/azure/generated/versioning-typechangedfrom/versioning/typechangedfrom/aio/_operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/versioning-typechangedfrom/versioning/typechangedfrom/aio/_operations/_operations.py @@ -133,8 +133,8 @@ async def test( params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "version": self._serialize.url("self._config.version", self._config.version, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) diff --git a/packages/typespec-python/test/unbranded/generated/server-path-multiple/server/path/multiple/_client.py b/packages/typespec-python/test/unbranded/generated/server-path-multiple/server/path/multiple/_client.py index 48b7d02c67c..ab67e2d83aa 100644 --- a/packages/typespec-python/test/unbranded/generated/server-path-multiple/server/path/multiple/_client.py +++ b/packages/typespec-python/test/unbranded/generated/server-path-multiple/server/path/multiple/_client.py @@ -65,10 +65,8 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "apiVersion": self._serialize.url( - "self._config.api_version", self._config.api_version, "str", skip_quote=True - ), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "apiVersion": self._serialize.url("self._config.api_version", self._config.api_version, "str"), } request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) diff --git a/packages/typespec-python/test/unbranded/generated/server-path-multiple/server/path/multiple/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/server-path-multiple/server/path/multiple/_operations/_operations.py index 3ddef635a0e..87b746edb52 100644 --- a/packages/typespec-python/test/unbranded/generated/server-path-multiple/server/path/multiple/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/server-path-multiple/server/path/multiple/_operations/_operations.py @@ -75,10 +75,8 @@ def no_operation_params(self, **kwargs: Any) -> None: # pylint: disable=inconsi params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "apiVersion": self._serialize.url( - "self._config.api_version", self._config.api_version, "str", skip_quote=True - ), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "apiVersion": self._serialize.url("self._config.api_version", self._config.api_version, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -124,10 +122,8 @@ def with_operation_path_param( # pylint: disable=inconsistent-return-statements params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "apiVersion": self._serialize.url( - "self._config.api_version", self._config.api_version, "str", skip_quote=True - ), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "apiVersion": self._serialize.url("self._config.api_version", self._config.api_version, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) diff --git a/packages/typespec-python/test/unbranded/generated/server-path-multiple/server/path/multiple/aio/_client.py b/packages/typespec-python/test/unbranded/generated/server-path-multiple/server/path/multiple/aio/_client.py index fc26d708289..590dad83ba5 100644 --- a/packages/typespec-python/test/unbranded/generated/server-path-multiple/server/path/multiple/aio/_client.py +++ b/packages/typespec-python/test/unbranded/generated/server-path-multiple/server/path/multiple/aio/_client.py @@ -67,10 +67,8 @@ def send_request( request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "apiVersion": self._serialize.url( - "self._config.api_version", self._config.api_version, "str", skip_quote=True - ), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "apiVersion": self._serialize.url("self._config.api_version", self._config.api_version, "str"), } request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) diff --git a/packages/typespec-python/test/unbranded/generated/server-path-multiple/server/path/multiple/aio/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/server-path-multiple/server/path/multiple/aio/_operations/_operations.py index 76d221cef2d..480ebc61d04 100644 --- a/packages/typespec-python/test/unbranded/generated/server-path-multiple/server/path/multiple/aio/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/server-path-multiple/server/path/multiple/aio/_operations/_operations.py @@ -54,10 +54,8 @@ async def no_operation_params(self, **kwargs: Any) -> None: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "apiVersion": self._serialize.url( - "self._config.api_version", self._config.api_version, "str", skip_quote=True - ), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "apiVersion": self._serialize.url("self._config.api_version", self._config.api_version, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -103,10 +101,8 @@ async def with_operation_path_param(self, keyword: str, **kwargs: Any) -> None: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "apiVersion": self._serialize.url( - "self._config.api_version", self._config.api_version, "str", skip_quote=True - ), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "apiVersion": self._serialize.url("self._config.api_version", self._config.api_version, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) diff --git a/packages/typespec-python/test/unbranded/generated/server-path-single/server/path/single/_client.py b/packages/typespec-python/test/unbranded/generated/server-path-single/server/path/single/_client.py index 9d94ede45c4..005113b78a7 100644 --- a/packages/typespec-python/test/unbranded/generated/server-path-single/server/path/single/_client.py +++ b/packages/typespec-python/test/unbranded/generated/server-path-single/server/path/single/_client.py @@ -62,7 +62,7 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), + "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) diff --git a/packages/typespec-python/test/unbranded/generated/server-path-single/server/path/single/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/server-path-single/server/path/single/_operations/_operations.py index eaf01cd840a..ad3885fe1bb 100644 --- a/packages/typespec-python/test/unbranded/generated/server-path-single/server/path/single/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/server-path-single/server/path/single/_operations/_operations.py @@ -61,7 +61,7 @@ def my_op(self, **kwargs: Any) -> bool: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), + "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) diff --git a/packages/typespec-python/test/unbranded/generated/server-path-single/server/path/single/aio/_client.py b/packages/typespec-python/test/unbranded/generated/server-path-single/server/path/single/aio/_client.py index cf39dec88d8..ce92ede3511 100644 --- a/packages/typespec-python/test/unbranded/generated/server-path-single/server/path/single/aio/_client.py +++ b/packages/typespec-python/test/unbranded/generated/server-path-single/server/path/single/aio/_client.py @@ -64,7 +64,7 @@ def send_request( request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), + "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) diff --git a/packages/typespec-python/test/unbranded/generated/server-path-single/server/path/single/aio/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/server-path-single/server/path/single/aio/_operations/_operations.py index c24af80cbaa..afcce6aa2aa 100644 --- a/packages/typespec-python/test/unbranded/generated/server-path-single/server/path/single/aio/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/server-path-single/server/path/single/aio/_operations/_operations.py @@ -51,7 +51,7 @@ async def my_op(self, **kwargs: Any) -> bool: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), + "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) diff --git a/packages/typespec-python/test/unbranded/generated/server-versions-not-versioned/server/versions/notversioned/_client.py b/packages/typespec-python/test/unbranded/generated/server-versions-not-versioned/server/versions/notversioned/_client.py index 3fd3619586f..23b47be24cc 100644 --- a/packages/typespec-python/test/unbranded/generated/server-versions-not-versioned/server/versions/notversioned/_client.py +++ b/packages/typespec-python/test/unbranded/generated/server-versions-not-versioned/server/versions/notversioned/_client.py @@ -62,7 +62,7 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), + "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) diff --git a/packages/typespec-python/test/unbranded/generated/server-versions-not-versioned/server/versions/notversioned/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/server-versions-not-versioned/server/versions/notversioned/_operations/_operations.py index 07307a32fca..ba5e916bedb 100644 --- a/packages/typespec-python/test/unbranded/generated/server-versions-not-versioned/server/versions/notversioned/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/server-versions-not-versioned/server/versions/notversioned/_operations/_operations.py @@ -90,7 +90,7 @@ def without_api_version(self, **kwargs: Any) -> bool: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), + "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) @@ -135,7 +135,7 @@ def with_query_api_version(self, *, api_version: str, **kwargs: Any) -> bool: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), + "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) @@ -180,7 +180,7 @@ def with_path_api_version(self, api_version: str, **kwargs: Any) -> bool: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), + "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) diff --git a/packages/typespec-python/test/unbranded/generated/server-versions-not-versioned/server/versions/notversioned/aio/_client.py b/packages/typespec-python/test/unbranded/generated/server-versions-not-versioned/server/versions/notversioned/aio/_client.py index df0f86b36d6..efde6d74c69 100644 --- a/packages/typespec-python/test/unbranded/generated/server-versions-not-versioned/server/versions/notversioned/aio/_client.py +++ b/packages/typespec-python/test/unbranded/generated/server-versions-not-versioned/server/versions/notversioned/aio/_client.py @@ -64,7 +64,7 @@ def send_request( request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), + "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) diff --git a/packages/typespec-python/test/unbranded/generated/server-versions-not-versioned/server/versions/notversioned/aio/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/server-versions-not-versioned/server/versions/notversioned/aio/_operations/_operations.py index 56164aee17d..87cbc24df0c 100644 --- a/packages/typespec-python/test/unbranded/generated/server-versions-not-versioned/server/versions/notversioned/aio/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/server-versions-not-versioned/server/versions/notversioned/aio/_operations/_operations.py @@ -55,7 +55,7 @@ async def without_api_version(self, **kwargs: Any) -> bool: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), + "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) @@ -102,7 +102,7 @@ async def with_query_api_version(self, *, api_version: str, **kwargs: Any) -> bo params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), + "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) @@ -149,7 +149,7 @@ async def with_path_api_version(self, api_version: str, **kwargs: Any) -> bool: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), + "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) diff --git a/packages/typespec-python/test/unbranded/generated/server-versions-versioned/server/versions/versioned/_client.py b/packages/typespec-python/test/unbranded/generated/server-versions-versioned/server/versions/versioned/_client.py index a1560cadfe2..88244d26e50 100644 --- a/packages/typespec-python/test/unbranded/generated/server-versions-versioned/server/versions/versioned/_client.py +++ b/packages/typespec-python/test/unbranded/generated/server-versions-versioned/server/versions/versioned/_client.py @@ -65,7 +65,7 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), + "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) diff --git a/packages/typespec-python/test/unbranded/generated/server-versions-versioned/server/versions/versioned/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/server-versions-versioned/server/versions/versioned/_operations/_operations.py index 778e6e8714f..3256fd7526c 100644 --- a/packages/typespec-python/test/unbranded/generated/server-versions-versioned/server/versions/versioned/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/server-versions-versioned/server/versions/versioned/_operations/_operations.py @@ -101,7 +101,7 @@ def without_api_version(self, **kwargs: Any) -> bool: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), + "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) @@ -144,7 +144,7 @@ def with_query_api_version(self, **kwargs: Any) -> bool: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), + "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) @@ -187,7 +187,7 @@ def with_path_api_version(self, **kwargs: Any) -> bool: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), + "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) @@ -230,7 +230,7 @@ def with_query_old_api_version(self, **kwargs: Any) -> bool: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), + "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) diff --git a/packages/typespec-python/test/unbranded/generated/server-versions-versioned/server/versions/versioned/aio/_client.py b/packages/typespec-python/test/unbranded/generated/server-versions-versioned/server/versions/versioned/aio/_client.py index 636a41a73b3..22217dca03c 100644 --- a/packages/typespec-python/test/unbranded/generated/server-versions-versioned/server/versions/versioned/aio/_client.py +++ b/packages/typespec-python/test/unbranded/generated/server-versions-versioned/server/versions/versioned/aio/_client.py @@ -67,7 +67,7 @@ def send_request( request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), + "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) diff --git a/packages/typespec-python/test/unbranded/generated/server-versions-versioned/server/versions/versioned/aio/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/server-versions-versioned/server/versions/versioned/aio/_operations/_operations.py index d655cce3d6c..5af20a690df 100644 --- a/packages/typespec-python/test/unbranded/generated/server-versions-versioned/server/versions/versioned/aio/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/server-versions-versioned/server/versions/versioned/aio/_operations/_operations.py @@ -56,7 +56,7 @@ async def without_api_version(self, **kwargs: Any) -> bool: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), + "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) @@ -101,7 +101,7 @@ async def with_query_api_version(self, **kwargs: Any) -> bool: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), + "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) @@ -146,7 +146,7 @@ async def with_path_api_version(self, **kwargs: Any) -> bool: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), + "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) @@ -191,7 +191,7 @@ async def with_query_old_api_version(self, **kwargs: Any) -> bool: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), + "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) diff --git a/packages/typespec-python/test/unbranded/generated/versioning-added/versioning/added/_client.py b/packages/typespec-python/test/unbranded/generated/versioning-added/versioning/added/_client.py index c5e890ffac7..a94f5ebc452 100644 --- a/packages/typespec-python/test/unbranded/generated/versioning-added/versioning/added/_client.py +++ b/packages/typespec-python/test/unbranded/generated/versioning-added/versioning/added/_client.py @@ -69,8 +69,8 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "version": self._serialize.url("self._config.version", self._config.version, "str"), } request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) diff --git a/packages/typespec-python/test/unbranded/generated/versioning-added/versioning/added/aio/_client.py b/packages/typespec-python/test/unbranded/generated/versioning-added/versioning/added/aio/_client.py index 5762260c5a0..9354edc9da2 100644 --- a/packages/typespec-python/test/unbranded/generated/versioning-added/versioning/added/aio/_client.py +++ b/packages/typespec-python/test/unbranded/generated/versioning-added/versioning/added/aio/_client.py @@ -71,8 +71,8 @@ def send_request( request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "version": self._serialize.url("self._config.version", self._config.version, "str"), } request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) diff --git a/packages/typespec-python/test/unbranded/generated/versioning-added/versioning/added/aio/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/versioning-added/versioning/added/aio/operations/_operations.py index 5a048fc4675..58fcdacc61a 100644 --- a/packages/typespec-python/test/unbranded/generated/versioning-added/versioning/added/aio/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/versioning-added/versioning/added/aio/operations/_operations.py @@ -146,8 +146,8 @@ async def v2_in_interface(self, body: Union[_models.ModelV2, JSON, IO[bytes]], * params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "version": self._serialize.url("self._config.version", self._config.version, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -277,8 +277,8 @@ async def v1( params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "version": self._serialize.url("self._config.version", self._config.version, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -393,8 +393,8 @@ async def v2(self, body: Union[_models.ModelV2, JSON, IO[bytes]], **kwargs: Any) params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "version": self._serialize.url("self._config.version", self._config.version, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) diff --git a/packages/typespec-python/test/unbranded/generated/versioning-added/versioning/added/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/versioning-added/versioning/added/operations/_operations.py index 9904cb16c2d..82123c56a2a 100644 --- a/packages/typespec-python/test/unbranded/generated/versioning-added/versioning/added/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/versioning-added/versioning/added/operations/_operations.py @@ -194,8 +194,8 @@ def v2_in_interface(self, body: Union[_models.ModelV2, JSON, IO[bytes]], **kwarg params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "version": self._serialize.url("self._config.version", self._config.version, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -323,8 +323,8 @@ def v1(self, body: Union[_models.ModelV1, JSON, IO[bytes]], *, header_v2: str, * params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "version": self._serialize.url("self._config.version", self._config.version, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -435,8 +435,8 @@ def v2(self, body: Union[_models.ModelV2, JSON, IO[bytes]], **kwargs: Any) -> _m params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "version": self._serialize.url("self._config.version", self._config.version, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) diff --git a/packages/typespec-python/test/unbranded/generated/versioning-madeoptional/versioning/madeoptional/_client.py b/packages/typespec-python/test/unbranded/generated/versioning-madeoptional/versioning/madeoptional/_client.py index 8604607aded..6d476fb55c6 100644 --- a/packages/typespec-python/test/unbranded/generated/versioning-madeoptional/versioning/madeoptional/_client.py +++ b/packages/typespec-python/test/unbranded/generated/versioning-madeoptional/versioning/madeoptional/_client.py @@ -66,8 +66,8 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "version": self._serialize.url("self._config.version", self._config.version, "str"), } request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) diff --git a/packages/typespec-python/test/unbranded/generated/versioning-madeoptional/versioning/madeoptional/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/versioning-madeoptional/versioning/madeoptional/_operations/_operations.py index 7e05293e716..54816ff3178 100644 --- a/packages/typespec-python/test/unbranded/generated/versioning-madeoptional/versioning/madeoptional/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/versioning-madeoptional/versioning/madeoptional/_operations/_operations.py @@ -160,8 +160,8 @@ def test( params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "version": self._serialize.url("self._config.version", self._config.version, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) diff --git a/packages/typespec-python/test/unbranded/generated/versioning-madeoptional/versioning/madeoptional/aio/_client.py b/packages/typespec-python/test/unbranded/generated/versioning-madeoptional/versioning/madeoptional/aio/_client.py index 19b352ffae9..efee6d46867 100644 --- a/packages/typespec-python/test/unbranded/generated/versioning-madeoptional/versioning/madeoptional/aio/_client.py +++ b/packages/typespec-python/test/unbranded/generated/versioning-madeoptional/versioning/madeoptional/aio/_client.py @@ -68,8 +68,8 @@ def send_request( request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "version": self._serialize.url("self._config.version", self._config.version, "str"), } request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) diff --git a/packages/typespec-python/test/unbranded/generated/versioning-madeoptional/versioning/madeoptional/aio/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/versioning-madeoptional/versioning/madeoptional/aio/_operations/_operations.py index 8b9d46ffe13..b47538e971d 100644 --- a/packages/typespec-python/test/unbranded/generated/versioning-madeoptional/versioning/madeoptional/aio/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/versioning-madeoptional/versioning/madeoptional/aio/_operations/_operations.py @@ -135,8 +135,8 @@ async def test( params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "version": self._serialize.url("self._config.version", self._config.version, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) diff --git a/packages/typespec-python/test/unbranded/generated/versioning-removed/versioning/removed/_client.py b/packages/typespec-python/test/unbranded/generated/versioning-removed/versioning/removed/_client.py index 6cc6e1b3920..107e370dbf5 100644 --- a/packages/typespec-python/test/unbranded/generated/versioning-removed/versioning/removed/_client.py +++ b/packages/typespec-python/test/unbranded/generated/versioning-removed/versioning/removed/_client.py @@ -66,8 +66,8 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "version": self._serialize.url("self._config.version", self._config.version, "str"), } request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) diff --git a/packages/typespec-python/test/unbranded/generated/versioning-removed/versioning/removed/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/versioning-removed/versioning/removed/_operations/_operations.py index a2d5ea67c5a..dd85006b453 100644 --- a/packages/typespec-python/test/unbranded/generated/versioning-removed/versioning/removed/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/versioning-removed/versioning/removed/_operations/_operations.py @@ -150,8 +150,8 @@ def v2(self, body: Union[_models.ModelV2, JSON, IO[bytes]], **kwargs: Any) -> _m params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "version": self._serialize.url("self._config.version", self._config.version, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -264,8 +264,8 @@ def model_v3(self, body: Union[_models.ModelV3, JSON, IO[bytes]], **kwargs: Any) params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "version": self._serialize.url("self._config.version", self._config.version, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) diff --git a/packages/typespec-python/test/unbranded/generated/versioning-removed/versioning/removed/aio/_client.py b/packages/typespec-python/test/unbranded/generated/versioning-removed/versioning/removed/aio/_client.py index deae9255467..ff351c7c177 100644 --- a/packages/typespec-python/test/unbranded/generated/versioning-removed/versioning/removed/aio/_client.py +++ b/packages/typespec-python/test/unbranded/generated/versioning-removed/versioning/removed/aio/_client.py @@ -68,8 +68,8 @@ def send_request( request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "version": self._serialize.url("self._config.version", self._config.version, "str"), } request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) diff --git a/packages/typespec-python/test/unbranded/generated/versioning-removed/versioning/removed/aio/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/versioning-removed/versioning/removed/aio/_operations/_operations.py index 0c41344187a..938ac3bc8c7 100644 --- a/packages/typespec-python/test/unbranded/generated/versioning-removed/versioning/removed/aio/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/versioning-removed/versioning/removed/aio/_operations/_operations.py @@ -115,8 +115,8 @@ async def v2(self, body: Union[_models.ModelV2, JSON, IO[bytes]], **kwargs: Any) params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "version": self._serialize.url("self._config.version", self._config.version, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -233,8 +233,8 @@ async def model_v3(self, body: Union[_models.ModelV3, JSON, IO[bytes]], **kwargs params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "version": self._serialize.url("self._config.version", self._config.version, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) diff --git a/packages/typespec-python/test/unbranded/generated/versioning-renamedfrom/versioning/renamedfrom/_client.py b/packages/typespec-python/test/unbranded/generated/versioning-renamedfrom/versioning/renamedfrom/_client.py index cb0eccc3835..e62c5b619e9 100644 --- a/packages/typespec-python/test/unbranded/generated/versioning-renamedfrom/versioning/renamedfrom/_client.py +++ b/packages/typespec-python/test/unbranded/generated/versioning-renamedfrom/versioning/renamedfrom/_client.py @@ -69,8 +69,8 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "version": self._serialize.url("self._config.version", self._config.version, "str"), } request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) diff --git a/packages/typespec-python/test/unbranded/generated/versioning-renamedfrom/versioning/renamedfrom/aio/_client.py b/packages/typespec-python/test/unbranded/generated/versioning-renamedfrom/versioning/renamedfrom/aio/_client.py index 39d54324317..38d1ba2eb4b 100644 --- a/packages/typespec-python/test/unbranded/generated/versioning-renamedfrom/versioning/renamedfrom/aio/_client.py +++ b/packages/typespec-python/test/unbranded/generated/versioning-renamedfrom/versioning/renamedfrom/aio/_client.py @@ -71,8 +71,8 @@ def send_request( request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "version": self._serialize.url("self._config.version", self._config.version, "str"), } request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) diff --git a/packages/typespec-python/test/unbranded/generated/versioning-renamedfrom/versioning/renamedfrom/aio/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/versioning-renamedfrom/versioning/renamedfrom/aio/operations/_operations.py index e7a2c5e3155..90a8e8bdb8b 100644 --- a/packages/typespec-python/test/unbranded/generated/versioning-renamedfrom/versioning/renamedfrom/aio/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/versioning-renamedfrom/versioning/renamedfrom/aio/operations/_operations.py @@ -142,8 +142,8 @@ async def new_op_in_new_interface( params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "version": self._serialize.url("self._config.version", self._config.version, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -270,8 +270,8 @@ async def new_op( params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "version": self._serialize.url("self._config.version", self._config.version, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) diff --git a/packages/typespec-python/test/unbranded/generated/versioning-renamedfrom/versioning/renamedfrom/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/versioning-renamedfrom/versioning/renamedfrom/operations/_operations.py index 2c623afcd99..6461e047df4 100644 --- a/packages/typespec-python/test/unbranded/generated/versioning-renamedfrom/versioning/renamedfrom/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/versioning-renamedfrom/versioning/renamedfrom/operations/_operations.py @@ -179,8 +179,8 @@ def new_op_in_new_interface( params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "version": self._serialize.url("self._config.version", self._config.version, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) @@ -307,8 +307,8 @@ def new_op( params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "version": self._serialize.url("self._config.version", self._config.version, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) diff --git a/packages/typespec-python/test/unbranded/generated/versioning-returntypechangedfrom/versioning/returntypechangedfrom/_client.py b/packages/typespec-python/test/unbranded/generated/versioning-returntypechangedfrom/versioning/returntypechangedfrom/_client.py index 45f89102886..735c7b8ca9c 100644 --- a/packages/typespec-python/test/unbranded/generated/versioning-returntypechangedfrom/versioning/returntypechangedfrom/_client.py +++ b/packages/typespec-python/test/unbranded/generated/versioning-returntypechangedfrom/versioning/returntypechangedfrom/_client.py @@ -68,8 +68,8 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "version": self._serialize.url("self._config.version", self._config.version, "str"), } request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) diff --git a/packages/typespec-python/test/unbranded/generated/versioning-returntypechangedfrom/versioning/returntypechangedfrom/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/versioning-returntypechangedfrom/versioning/returntypechangedfrom/_operations/_operations.py index 4c55fbd289f..3868c67d38d 100644 --- a/packages/typespec-python/test/unbranded/generated/versioning-returntypechangedfrom/versioning/returntypechangedfrom/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/versioning-returntypechangedfrom/versioning/returntypechangedfrom/_operations/_operations.py @@ -82,8 +82,8 @@ def test(self, body: str, **kwargs: Any) -> str: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "version": self._serialize.url("self._config.version", self._config.version, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) diff --git a/packages/typespec-python/test/unbranded/generated/versioning-returntypechangedfrom/versioning/returntypechangedfrom/aio/_client.py b/packages/typespec-python/test/unbranded/generated/versioning-returntypechangedfrom/versioning/returntypechangedfrom/aio/_client.py index 94c04a16ef9..94c306aa588 100644 --- a/packages/typespec-python/test/unbranded/generated/versioning-returntypechangedfrom/versioning/returntypechangedfrom/aio/_client.py +++ b/packages/typespec-python/test/unbranded/generated/versioning-returntypechangedfrom/versioning/returntypechangedfrom/aio/_client.py @@ -70,8 +70,8 @@ def send_request( request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "version": self._serialize.url("self._config.version", self._config.version, "str"), } request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) diff --git a/packages/typespec-python/test/unbranded/generated/versioning-returntypechangedfrom/versioning/returntypechangedfrom/aio/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/versioning-returntypechangedfrom/versioning/returntypechangedfrom/aio/_operations/_operations.py index 8c47b1ea997..60a889c74cf 100644 --- a/packages/typespec-python/test/unbranded/generated/versioning-returntypechangedfrom/versioning/returntypechangedfrom/aio/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/versioning-returntypechangedfrom/versioning/returntypechangedfrom/aio/_operations/_operations.py @@ -63,8 +63,8 @@ async def test(self, body: str, **kwargs: Any) -> str: params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "version": self._serialize.url("self._config.version", self._config.version, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) diff --git a/packages/typespec-python/test/unbranded/generated/versioning-typechangedfrom/versioning/typechangedfrom/_client.py b/packages/typespec-python/test/unbranded/generated/versioning-typechangedfrom/versioning/typechangedfrom/_client.py index b4eeddf80d8..ac86efe3cce 100644 --- a/packages/typespec-python/test/unbranded/generated/versioning-typechangedfrom/versioning/typechangedfrom/_client.py +++ b/packages/typespec-python/test/unbranded/generated/versioning-typechangedfrom/versioning/typechangedfrom/_client.py @@ -66,8 +66,8 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "version": self._serialize.url("self._config.version", self._config.version, "str"), } request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) diff --git a/packages/typespec-python/test/unbranded/generated/versioning-typechangedfrom/versioning/typechangedfrom/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/versioning-typechangedfrom/versioning/typechangedfrom/_operations/_operations.py index d7df9956fdf..cdd05434a50 100644 --- a/packages/typespec-python/test/unbranded/generated/versioning-typechangedfrom/versioning/typechangedfrom/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/versioning-typechangedfrom/versioning/typechangedfrom/_operations/_operations.py @@ -152,8 +152,8 @@ def test(self, body: Union[_models.TestModel, JSON, IO[bytes]], *, param: str, * params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "version": self._serialize.url("self._config.version", self._config.version, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) diff --git a/packages/typespec-python/test/unbranded/generated/versioning-typechangedfrom/versioning/typechangedfrom/aio/_client.py b/packages/typespec-python/test/unbranded/generated/versioning-typechangedfrom/versioning/typechangedfrom/aio/_client.py index 08ba454bf31..a8ba61eee69 100644 --- a/packages/typespec-python/test/unbranded/generated/versioning-typechangedfrom/versioning/typechangedfrom/aio/_client.py +++ b/packages/typespec-python/test/unbranded/generated/versioning-typechangedfrom/versioning/typechangedfrom/aio/_client.py @@ -68,8 +68,8 @@ def send_request( request_copy = deepcopy(request) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "version": self._serialize.url("self._config.version", self._config.version, "str"), } request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) diff --git a/packages/typespec-python/test/unbranded/generated/versioning-typechangedfrom/versioning/typechangedfrom/aio/_operations/_operations.py b/packages/typespec-python/test/unbranded/generated/versioning-typechangedfrom/versioning/typechangedfrom/aio/_operations/_operations.py index b370eceeba5..0c5277ec057 100644 --- a/packages/typespec-python/test/unbranded/generated/versioning-typechangedfrom/versioning/typechangedfrom/aio/_operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/versioning-typechangedfrom/versioning/typechangedfrom/aio/_operations/_operations.py @@ -130,8 +130,8 @@ async def test( params=_params, ) path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str"), - "version": self._serialize.url("self._config.version", self._config.version, "str", skip_quote=True), + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "version": self._serialize.url("self._config.version", self._config.version, "str"), } _request.url = self._client.format_url(_request.url, **path_format_arguments) From de30f5e20bb650e57afa4e5e6d6efc41548cfc7d Mon Sep 17 00:00:00 2001 From: tadelesh Date: Tue, 1 Apr 2025 15:37:19 +0800 Subject: [PATCH 05/19] change option --- packages/typespec-python/src/lib.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/typespec-python/src/lib.ts b/packages/typespec-python/src/lib.ts index c38f50cf0f2..e28a0aa76d5 100644 --- a/packages/typespec-python/src/lib.ts +++ b/packages/typespec-python/src/lib.ts @@ -1,8 +1,11 @@ -import { SdkContext, SdkServiceOperation } from "@azure-tools/typespec-client-generator-core"; +import { SdkContext, SdkServiceOperation, BrandedSdkEmitterOptions } from "@azure-tools/typespec-client-generator-core"; import { createTypeSpecLibrary, JSONSchemaType } from "@typespec/compiler"; import { PythonEmitterOptions, PythonEmitterOptionsSchema } from "@typespec/http-client-python"; export interface PythonAzureEmitterOptions extends PythonEmitterOptions { + "examples-dir"?: string; + namespace?: string; + "flavor"?: "azure"; "models-mode"?: string; "generate-sample"?: boolean; @@ -16,8 +19,11 @@ export interface PythonSdkContext const PythonAzureEmitterOptionsSchema: JSONSchemaType = { type: "object", - additionalProperties: true, + additionalProperties: false, properties: { + ...BrandedSdkEmitterOptions["examples-dir"], + ...BrandedSdkEmitterOptions["namespace"], + "flavor": { type: "string", nullable: true, From 8114eadeb843cf446582919517f8fd34a0468200 Mon Sep 17 00:00:00 2001 From: tadelesh Date: Tue, 1 Apr 2025 20:01:44 +0800 Subject: [PATCH 06/19] fix test --- .../asynctests/test_headasboolean_async.py | 8 ++++---- .../asynctests/test_typetest_model_visibility_async.py | 2 +- .../test/generic_mock_api_tests/test_headasboolean.py | 8 ++++---- .../test_typetest_model_visibility.py | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/typespec-python/test/generic_mock_api_tests/asynctests/test_headasboolean_async.py b/packages/typespec-python/test/generic_mock_api_tests/asynctests/test_headasboolean_async.py index 0ec3574286f..c0f69198712 100644 --- a/packages/typespec-python/test/generic_mock_api_tests/asynctests/test_headasboolean_async.py +++ b/packages/typespec-python/test/generic_mock_api_tests/asynctests/test_headasboolean_async.py @@ -25,11 +25,11 @@ async def client_false(): @pytest.mark.asyncio async def test_head_true(client_true): - body = models_true.VisibilityModel(query_prop=123) - assert await client_true.head_model(body) == True + body = models_true.VisibilityModel() + assert await client_true.head_model(body, query_prop=123) == True @pytest.mark.asyncio async def test_head_false(client_false): - body = models_false.VisibilityModel(query_prop=123) - assert await client_false.head_model(body) is None + body = models_false.VisibilityModel() + assert await client_false.head_model(body, query_prop=123) is None diff --git a/packages/typespec-python/test/generic_mock_api_tests/asynctests/test_typetest_model_visibility_async.py b/packages/typespec-python/test/generic_mock_api_tests/asynctests/test_typetest_model_visibility_async.py index e73d7f3030d..27fb23df8aa 100644 --- a/packages/typespec-python/test/generic_mock_api_tests/asynctests/test_typetest_model_visibility_async.py +++ b/packages/typespec-python/test/generic_mock_api_tests/asynctests/test_typetest_model_visibility_async.py @@ -16,7 +16,7 @@ async def client(): @pytest.mark.asyncio async def test_get_model(client): - result = await client.get_model(models.VisibilityModel(query_prop=123)) + result = await client.get_model(models.VisibilityModel(), query_prop=123) assert result == models.VisibilityModel(read_prop="abc") diff --git a/packages/typespec-python/test/generic_mock_api_tests/test_headasboolean.py b/packages/typespec-python/test/generic_mock_api_tests/test_headasboolean.py index a8c5db102bd..c26d63d39f5 100644 --- a/packages/typespec-python/test/generic_mock_api_tests/test_headasboolean.py +++ b/packages/typespec-python/test/generic_mock_api_tests/test_headasboolean.py @@ -24,10 +24,10 @@ def client_false(): def test_head_true(client_true): - body = models_true.VisibilityModel(query_prop=123) - assert client_true.head_model(body) == True + body = models_true.VisibilityModel() + assert client_true.head_model(body, query_prop=123) == True def test_head_false(client_false): - body = models_false.VisibilityModel(query_prop=123) - assert client_false.head_model(body) is None + body = models_false.VisibilityModel() + assert client_false.head_model(body, query_prop=123) is None diff --git a/packages/typespec-python/test/generic_mock_api_tests/test_typetest_model_visibility.py b/packages/typespec-python/test/generic_mock_api_tests/test_typetest_model_visibility.py index 8f06c076626..c6f4695f2fa 100644 --- a/packages/typespec-python/test/generic_mock_api_tests/test_typetest_model_visibility.py +++ b/packages/typespec-python/test/generic_mock_api_tests/test_typetest_model_visibility.py @@ -14,7 +14,7 @@ def client(): def test_get_model(client): - result = client.get_model(models.VisibilityModel(query_prop=123)) + result = client.get_model(models.VisibilityModel(), query_prop=123) assert result == models.VisibilityModel(read_prop="abc") From fb831e0da0a68288f10c1ef6d380389f10559715 Mon Sep 17 00:00:00 2001 From: AutoPrFromHttpClientPython Date: Tue, 1 Apr 2025 12:47:34 +0000 Subject: [PATCH 07/19] Update dependencies (2025-04-01 12:47:34) --- packages/autorest.python/package.json | 2 +- packages/typespec-python/package.json | 2 +- pnpm-lock.yaml | 16 ++++++++-------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/autorest.python/package.json b/packages/autorest.python/package.json index 574359fe8f9..a35206cc380 100644 --- a/packages/autorest.python/package.json +++ b/packages/autorest.python/package.json @@ -29,7 +29,7 @@ }, "homepage": "https://github.com/Azure/autorest.python/blob/main/README.md", "dependencies": { - "@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcwOTA2Mi9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.2.tgz", + "@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcwOTg1Ny9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.2.tgz", "@autorest/system-requirements": "~1.0.2", "fs-extra": "~11.2.0", "tsx": "~4.19.1" diff --git a/packages/typespec-python/package.json b/packages/typespec-python/package.json index 8f176d1e578..cbe697af71b 100644 --- a/packages/typespec-python/package.json +++ b/packages/typespec-python/package.json @@ -63,7 +63,7 @@ "js-yaml": "~4.1.0", "semver": "~7.6.2", "tsx": "~4.19.1", - "@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcwOTA2Mi9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.2.tgz", + "@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcwOTg1Ny9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.2.tgz", "fs-extra": "~11.2.0" }, "devDependencies": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d0880f3b1d4..8ac437669df 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -57,8 +57,8 @@ importers: specifier: ~1.0.2 version: 1.0.2 '@typespec/http-client-python': - specifier: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcwOTA2Mi9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.2.tgz - version: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcwOTA2Mi9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.2.tgz(vc45nnffght74sl4sibvll3pxy) + specifier: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcwOTg1Ny9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.2.tgz + version: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcwOTg1Ny9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.2.tgz(vc45nnffght74sl4sibvll3pxy) fs-extra: specifier: ~11.2.0 version: 11.2.0 @@ -79,8 +79,8 @@ importers: packages/typespec-python: dependencies: '@typespec/http-client-python': - specifier: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcwOTA2Mi9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.2.tgz - version: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcwOTA2Mi9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.2.tgz(vqafh2xgemu2dyfvlgvmut4cti) + specifier: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcwOTg1Ny9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.2.tgz + version: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcwOTg1Ny9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.2.tgz(vqafh2xgemu2dyfvlgvmut4cti) fs-extra: specifier: ~11.2.0 version: 11.2.0 @@ -1659,8 +1659,8 @@ packages: peerDependencies: '@typespec/compiler': ^0.67.1 || >=0.68.0-dev <0.68.0 - '@typespec/http-client-python@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcwOTA2Mi9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.2.tgz': - resolution: {tarball: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcwOTA2Mi9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.2.tgz} + '@typespec/http-client-python@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcwOTg1Ny9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.2.tgz': + resolution: {tarball: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcwOTg1Ny9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.2.tgz} version: 0.8.2 engines: {node: '>=20.0.0'} peerDependencies: @@ -6337,7 +6337,7 @@ snapshots: dependencies: '@typespec/compiler': 0.68.0-dev.12(@types/node@22.5.5) - '@typespec/http-client-python@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcwOTA2Mi9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.2.tgz(vc45nnffght74sl4sibvll3pxy)': + '@typespec/http-client-python@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcwOTg1Ny9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.2.tgz(vc45nnffght74sl4sibvll3pxy)': dependencies: '@azure-tools/typespec-autorest': 0.54.0-dev.5(sc7idhpgkzao6ca27f5n4spwdm) '@azure-tools/typespec-azure-core': 0.54.0-dev.5(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))))(@typespec/rest@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))))) @@ -6361,7 +6361,7 @@ snapshots: - bufferutil - utf-8-validate - '@typespec/http-client-python@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcwOTA2Mi9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.2.tgz(vqafh2xgemu2dyfvlgvmut4cti)': + '@typespec/http-client-python@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcwOTg1Ny9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.2.tgz(vqafh2xgemu2dyfvlgvmut4cti)': dependencies: '@azure-tools/typespec-autorest': 0.54.0-dev.5(terlvcbdqtyv3m5pmsko2l6fny) '@azure-tools/typespec-azure-core': 0.54.0-dev.5(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))(@typespec/rest@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))) From a186b4e16e4fcb4e44415546486dd187a6421b17 Mon Sep 17 00:00:00 2001 From: AutoPrFromHttpClientPython Date: Tue, 1 Apr 2025 12:50:12 +0000 Subject: [PATCH 08/19] Regenerate for typespec-python (2025-04-01 12:50:12) --- .../resiliency-srv-driven1/CHANGELOG.md | 5 - .../generated/resiliency-srv-driven1/LICENSE | 21 - .../resiliency-srv-driven1/MANIFEST.in | 7 - .../resiliency-srv-driven1/README.md | 43 - .../apiview-properties.json | 8 - .../dev_requirements.txt | 3 - .../generated_tests/conftest.py | 41 - .../test_resiliency_service_driven.py | 36 - .../test_resiliency_service_driven_async.py | 37 - .../generated_tests/testpreparer.py | 22 - .../generated_tests/testpreparer_async.py | 14 - .../resiliency/__init__.py | 1 - .../resiliency/srv/__init__.py | 1 - .../resiliency/srv/driven1/__init__.py | 26 - .../resiliency/srv/driven1/_client.py | 103 - .../resiliency/srv/driven1/_configuration.py | 53 - .../resiliency/srv/driven1/_model_base.py | 1230 ---------- .../srv/driven1/_operations/__init__.py | 19 - .../srv/driven1/_operations/_operations.py | 228 -- .../srv/driven1/_operations/_patch.py | 21 - .../resiliency/srv/driven1/_patch.py | 21 - .../resiliency/srv/driven1/_serialization.py | 2026 ----------------- .../resiliency/srv/driven1/_vendor.py | 18 - .../resiliency/srv/driven1/_version.py | 3 - .../resiliency/srv/driven1/aio/__init__.py | 23 - .../resiliency/srv/driven1/aio/_client.py | 105 - .../srv/driven1/aio/_configuration.py | 53 - .../srv/driven1/aio/_operations/__init__.py | 19 - .../driven1/aio/_operations/_operations.py | 189 -- .../srv/driven1/aio/_operations/_patch.py | 21 - .../resiliency/srv/driven1/aio/_patch.py | 21 - .../resiliency/srv/driven1/aio/_vendor.py | 18 - .../resiliency/srv/driven1/py.typed | 1 - .../generated/resiliency-srv-driven1/setup.py | 65 - .../resiliency-srv-driven2/CHANGELOG.md | 5 - .../generated/resiliency-srv-driven2/LICENSE | 21 - .../resiliency-srv-driven2/MANIFEST.in | 7 - .../resiliency-srv-driven2/README.md | 43 - .../apiview-properties.json | 9 - .../dev_requirements.txt | 3 - .../generated_tests/conftest.py | 41 - .../test_resiliency_service_driven.py | 45 - .../test_resiliency_service_driven_async.py | 46 - .../generated_tests/testpreparer.py | 22 - .../generated_tests/testpreparer_async.py | 14 - .../resiliency/__init__.py | 1 - .../resiliency/srv/__init__.py | 1 - .../resiliency/srv/driven2/__init__.py | 26 - .../resiliency/srv/driven2/_client.py | 120 - .../resiliency/srv/driven2/_configuration.py | 53 - .../resiliency/srv/driven2/_model_base.py | 1230 ---------- .../srv/driven2/_operations/__init__.py | 19 - .../srv/driven2/_operations/_operations.py | 318 --- .../srv/driven2/_operations/_patch.py | 21 - .../resiliency/srv/driven2/_patch.py | 21 - .../resiliency/srv/driven2/_serialization.py | 2026 ----------------- .../resiliency/srv/driven2/_validation.py | 44 - .../resiliency/srv/driven2/_vendor.py | 18 - .../resiliency/srv/driven2/_version.py | 3 - .../resiliency/srv/driven2/aio/__init__.py | 23 - .../resiliency/srv/driven2/aio/_client.py | 122 - .../srv/driven2/aio/_configuration.py | 53 - .../srv/driven2/aio/_operations/__init__.py | 19 - .../driven2/aio/_operations/_operations.py | 261 --- .../srv/driven2/aio/_operations/_patch.py | 21 - .../resiliency/srv/driven2/aio/_patch.py | 21 - .../resiliency/srv/driven2/aio/_vendor.py | 18 - .../resiliency/srv/driven2/py.typed | 1 - .../generated/resiliency-srv-driven2/setup.py | 65 - 69 files changed, 9263 deletions(-) delete mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven1/CHANGELOG.md delete mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven1/LICENSE delete mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven1/MANIFEST.in delete mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven1/README.md delete mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven1/apiview-properties.json delete mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven1/dev_requirements.txt delete mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven1/generated_tests/conftest.py delete mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven1/generated_tests/test_resiliency_service_driven.py delete mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven1/generated_tests/test_resiliency_service_driven_async.py delete mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven1/generated_tests/testpreparer.py delete mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven1/generated_tests/testpreparer_async.py delete mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_client.py delete mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_configuration.py delete mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_model_base.py delete mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_operations/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_operations/_operations.py delete mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_operations/_patch.py delete mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_patch.py delete mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_serialization.py delete mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_vendor.py delete mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_version.py delete mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/aio/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/aio/_client.py delete mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/aio/_configuration.py delete mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/aio/_operations/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/aio/_operations/_operations.py delete mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/aio/_operations/_patch.py delete mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/aio/_patch.py delete mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/aio/_vendor.py delete mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/py.typed delete mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven1/setup.py delete mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven2/CHANGELOG.md delete mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven2/LICENSE delete mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven2/MANIFEST.in delete mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven2/README.md delete mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven2/apiview-properties.json delete mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven2/dev_requirements.txt delete mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven2/generated_tests/conftest.py delete mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven2/generated_tests/test_resiliency_service_driven.py delete mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven2/generated_tests/test_resiliency_service_driven_async.py delete mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven2/generated_tests/testpreparer.py delete mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven2/generated_tests/testpreparer_async.py delete mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_client.py delete mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_configuration.py delete mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_model_base.py delete mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_operations/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_operations/_operations.py delete mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_operations/_patch.py delete mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_patch.py delete mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_serialization.py delete mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_validation.py delete mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_vendor.py delete mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_version.py delete mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/aio/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/aio/_client.py delete mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/aio/_configuration.py delete mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/aio/_operations/__init__.py delete mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/aio/_operations/_operations.py delete mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/aio/_operations/_patch.py delete mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/aio/_patch.py delete mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/aio/_vendor.py delete mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/py.typed delete mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven2/setup.py diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/CHANGELOG.md b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/CHANGELOG.md deleted file mode 100644 index 628743d283a..00000000000 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/CHANGELOG.md +++ /dev/null @@ -1,5 +0,0 @@ -# Release History - -## 1.0.0b1 (1970-01-01) - -- Initial version diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/LICENSE b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/LICENSE deleted file mode 100644 index 63447fd8bbb..00000000000 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -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/resiliency-srv-driven1/MANIFEST.in b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/MANIFEST.in deleted file mode 100644 index 0afda28e610..00000000000 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/MANIFEST.in +++ /dev/null @@ -1,7 +0,0 @@ -include *.md -include LICENSE -include resiliency/srv/driven1/py.typed -recursive-include tests *.py -recursive-include samples *.py *.md -include resiliency/__init__.py -include resiliency/srv/__init__.py diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/README.md b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/README.md deleted file mode 100644 index 74ce9cfcdee..00000000000 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/README.md +++ /dev/null @@ -1,43 +0,0 @@ -# ResiliencySrvDriven1 client library for Python - - -## Getting started - -### Install the package - -```bash -python -m pip install resiliency-srv-driven1 -``` - -#### 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 ResiliencySrvDriven1 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/resiliency-srv-driven1/apiview-properties.json b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/apiview-properties.json deleted file mode 100644 index cca76b075c5..00000000000 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/apiview-properties.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "CrossLanguagePackageId": "Resiliency.ServiceDriven", - "CrossLanguageDefinitionId": { - "resiliency.srv.driven1.ResiliencyServiceDrivenClient.from_none": "Resiliency.ServiceDriven.AddOptionalParam.fromNone", - "resiliency.srv.driven1.ResiliencyServiceDrivenClient.from_one_required": "Resiliency.ServiceDriven.AddOptionalParam.fromOneRequired", - "resiliency.srv.driven1.ResiliencyServiceDrivenClient.from_one_optional": "Resiliency.ServiceDriven.AddOptionalParam.fromOneOptional" - } -} \ No newline at end of file diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/dev_requirements.txt b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/dev_requirements.txt deleted file mode 100644 index 10548647144..00000000000 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/dev_requirements.txt +++ /dev/null @@ -1,3 +0,0 @@ --e ../../../tools/azure-sdk-tools -../../core/azure-core -aiohttp \ No newline at end of file diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/generated_tests/conftest.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/generated_tests/conftest.py deleted file mode 100644 index a8b02f1c29e..00000000000 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/generated_tests/conftest.py +++ /dev/null @@ -1,41 +0,0 @@ -# coding=utf-8 -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() - - -# For security, please avoid record sensitive identity information in recordings -@pytest.fixture(scope="session", autouse=True) -def add_sanitizers(test_proxy): - resiliencyservicedriven_subscription_id = os.environ.get( - "RESILIENCYSERVICEDRIVEN_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000" - ) - resiliencyservicedriven_tenant_id = os.environ.get( - "RESILIENCYSERVICEDRIVEN_TENANT_ID", "00000000-0000-0000-0000-000000000000" - ) - resiliencyservicedriven_client_id = os.environ.get( - "RESILIENCYSERVICEDRIVEN_CLIENT_ID", "00000000-0000-0000-0000-000000000000" - ) - resiliencyservicedriven_client_secret = os.environ.get( - "RESILIENCYSERVICEDRIVEN_CLIENT_SECRET", "00000000-0000-0000-0000-000000000000" - ) - add_general_regex_sanitizer( - regex=resiliencyservicedriven_subscription_id, value="00000000-0000-0000-0000-000000000000" - ) - add_general_regex_sanitizer(regex=resiliencyservicedriven_tenant_id, value="00000000-0000-0000-0000-000000000000") - add_general_regex_sanitizer(regex=resiliencyservicedriven_client_id, value="00000000-0000-0000-0000-000000000000") - add_general_regex_sanitizer( - regex=resiliencyservicedriven_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/resiliency-srv-driven1/generated_tests/test_resiliency_service_driven.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/generated_tests/test_resiliency_service_driven.py deleted file mode 100644 index 58499e1d169..00000000000 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/generated_tests/test_resiliency_service_driven.py +++ /dev/null @@ -1,36 +0,0 @@ -# coding=utf-8 -import pytest -from devtools_testutils import recorded_by_proxy -from testpreparer import ResiliencyServiceDrivenClientTestBase, ResiliencyServiceDrivenPreparer - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestResiliencyServiceDriven(ResiliencyServiceDrivenClientTestBase): - @ResiliencyServiceDrivenPreparer() - @recorded_by_proxy - def test_from_none(self, resiliencyservicedriven_endpoint): - client = self.create_client(endpoint=resiliencyservicedriven_endpoint) - response = client.from_none() - - # please add some check logic here by yourself - # ... - - @ResiliencyServiceDrivenPreparer() - @recorded_by_proxy - def test_from_one_required(self, resiliencyservicedriven_endpoint): - client = self.create_client(endpoint=resiliencyservicedriven_endpoint) - response = client.from_one_required( - parameter="str", - ) - - # please add some check logic here by yourself - # ... - - @ResiliencyServiceDrivenPreparer() - @recorded_by_proxy - def test_from_one_optional(self, resiliencyservicedriven_endpoint): - client = self.create_client(endpoint=resiliencyservicedriven_endpoint) - response = client.from_one_optional() - - # please add some check logic here by yourself - # ... diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/generated_tests/test_resiliency_service_driven_async.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/generated_tests/test_resiliency_service_driven_async.py deleted file mode 100644 index 1998fbcccdd..00000000000 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/generated_tests/test_resiliency_service_driven_async.py +++ /dev/null @@ -1,37 +0,0 @@ -# coding=utf-8 -import pytest -from devtools_testutils.aio import recorded_by_proxy_async -from testpreparer import ResiliencyServiceDrivenPreparer -from testpreparer_async import ResiliencyServiceDrivenClientTestBaseAsync - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestResiliencyServiceDrivenAsync(ResiliencyServiceDrivenClientTestBaseAsync): - @ResiliencyServiceDrivenPreparer() - @recorded_by_proxy_async - async def test_from_none(self, resiliencyservicedriven_endpoint): - client = self.create_async_client(endpoint=resiliencyservicedriven_endpoint) - response = await client.from_none() - - # please add some check logic here by yourself - # ... - - @ResiliencyServiceDrivenPreparer() - @recorded_by_proxy_async - async def test_from_one_required(self, resiliencyservicedriven_endpoint): - client = self.create_async_client(endpoint=resiliencyservicedriven_endpoint) - response = await client.from_one_required( - parameter="str", - ) - - # please add some check logic here by yourself - # ... - - @ResiliencyServiceDrivenPreparer() - @recorded_by_proxy_async - async def test_from_one_optional(self, resiliencyservicedriven_endpoint): - client = self.create_async_client(endpoint=resiliencyservicedriven_endpoint) - response = await client.from_one_optional() - - # please add some check logic here by yourself - # ... diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/generated_tests/testpreparer.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/generated_tests/testpreparer.py deleted file mode 100644 index 6acb31d75c4..00000000000 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/generated_tests/testpreparer.py +++ /dev/null @@ -1,22 +0,0 @@ -# coding=utf-8 -from devtools_testutils import AzureRecordedTestCase, PowerShellPreparer -import functools -from resiliency.srv.driven1 import ResiliencyServiceDrivenClient - - -class ResiliencyServiceDrivenClientTestBase(AzureRecordedTestCase): - - def create_client(self, endpoint): - credential = self.get_credential(ResiliencyServiceDrivenClient) - return self.create_client_from_credential( - ResiliencyServiceDrivenClient, - credential=credential, - endpoint=endpoint, - ) - - -ResiliencyServiceDrivenPreparer = functools.partial( - PowerShellPreparer, - "resiliencyservicedriven", - resiliencyservicedriven_endpoint="https://fake_resiliencyservicedriven_endpoint.com", -) diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/generated_tests/testpreparer_async.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/generated_tests/testpreparer_async.py deleted file mode 100644 index b3ac849dbfe..00000000000 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/generated_tests/testpreparer_async.py +++ /dev/null @@ -1,14 +0,0 @@ -# coding=utf-8 -from devtools_testutils import AzureRecordedTestCase -from resiliency.srv.driven1.aio import ResiliencyServiceDrivenClient - - -class ResiliencyServiceDrivenClientTestBaseAsync(AzureRecordedTestCase): - - def create_async_client(self, endpoint): - credential = self.get_credential(ResiliencyServiceDrivenClient, is_async=True) - return self.create_client_from_credential( - ResiliencyServiceDrivenClient, - credential=credential, - endpoint=endpoint, - ) diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/__init__.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/__init__.py deleted file mode 100644 index d55ccad1f57..00000000000 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/__init__.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/__init__.py deleted file mode 100644 index d55ccad1f57..00000000000 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/__init__.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/__init__.py deleted file mode 100644 index 777f7bc99dd..00000000000 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/__init__.py +++ /dev/null @@ -1,26 +0,0 @@ -# coding=utf-8 -# pylint: disable=wrong-import-position - -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from ._patch import * # pylint: disable=unused-wildcard-import - -from ._client import ResiliencyServiceDrivenClient # type: ignore -from ._version import VERSION - -__version__ = VERSION - -try: - from ._patch import __all__ as _patch_all - from ._patch import * -except ImportError: - _patch_all = [] -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "ResiliencyServiceDrivenClient", -] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore - -_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_client.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_client.py deleted file mode 100644 index fa40a38818d..00000000000 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_client.py +++ /dev/null @@ -1,103 +0,0 @@ -# coding=utf-8 - -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 ResiliencyServiceDrivenClientConfiguration -from ._operations import ResiliencyServiceDrivenClientOperationsMixin -from ._serialization import Deserializer, Serializer - - -class ResiliencyServiceDrivenClient(ResiliencyServiceDrivenClientOperationsMixin): - """Test that we can grow up a service spec and service deployment into a multi-versioned service - with full client support. - - :param endpoint: Need to be set as '`http://localhost:3000 `_' in - client. Required. - :type endpoint: str - :param service_deployment_version: Pass in either 'v1' or 'v2'. This represents a version of - the service deployment in history. 'v1' is for the deployment when the service had only one api - version. 'v2' is for the deployment when the service had api-versions 'v1' and 'v2'. Required. - :type service_deployment_version: str - :keyword api_version: Pass in 'v1'. This represents the API version of the service. Will grow - up in the next deployment to be both 'v1' and 'v2'. Known values are "v1" and None. Default - value is "v1". Note that overriding this default value may result in unsupported behavior. - :paramtype api_version: str - """ - - def __init__( # pylint: disable=missing-client-constructor-parameter-credential - self, endpoint: str, service_deployment_version: str, **kwargs: Any - ) -> None: - _endpoint = ( - "{endpoint}/resiliency/service-driven/client:v1/service:{serviceDeploymentVersion}/api-version:{apiVersion}" - ) - self._config = ResiliencyServiceDrivenClientConfiguration( - endpoint=endpoint, service_deployment_version=service_deployment_version, **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 - - 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), - "serviceDeploymentVersion": self._serialize.url( - "self._config.service_deployment_version", self._config.service_deployment_version, "str" - ), - "apiVersion": self._serialize.url("self._config.api_version", self._config.api_version, "str"), - } - - 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/resiliency-srv-driven1/resiliency/srv/driven1/_configuration.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_configuration.py deleted file mode 100644 index 3e5ae14d4e5..00000000000 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_configuration.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding=utf-8 - -from typing import Any - -from azure.core.pipeline import policies - -from ._version import VERSION - - -class ResiliencyServiceDrivenClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long - """Configuration for ResiliencyServiceDrivenClient. - - Note that all parameters used to create this instance are saved as instance - attributes. - - :param endpoint: Need to be set as '`http://localhost:3000 `_' in - client. Required. - :type endpoint: str - :param service_deployment_version: Pass in either 'v1' or 'v2'. This represents a version of - the service deployment in history. 'v1' is for the deployment when the service had only one api - version. 'v2' is for the deployment when the service had api-versions 'v1' and 'v2'. Required. - :type service_deployment_version: str - :keyword api_version: Pass in 'v1'. This represents the API version of the service. Will grow - up in the next deployment to be both 'v1' and 'v2'. Known values are "v1" and None. Default - value is "v1". Note that overriding this default value may result in unsupported behavior. - :paramtype api_version: str - """ - - def __init__(self, endpoint: str, service_deployment_version: str, **kwargs: Any) -> None: - api_version: str = kwargs.pop("api_version", "v1") - - if endpoint is None: - raise ValueError("Parameter 'endpoint' must not be None.") - if service_deployment_version is None: - raise ValueError("Parameter 'service_deployment_version' must not be None.") - - self.endpoint = endpoint - self.service_deployment_version = service_deployment_version - self.api_version = api_version - kwargs.setdefault("sdk_moniker", "resiliency-srv-driven1/{}".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/resiliency-srv-driven1/resiliency/srv/driven1/_model_base.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_model_base.py deleted file mode 100644 index e8ecb270bd8..00000000000 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_model_base.py +++ /dev/null @@ -1,1230 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# pylint: disable=protected-access, 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 -import xml.etree.ElementTree as ET -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"] - 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)) - - -def _deserialize_int_as_str(attr): - if isinstance(attr, int): - return attr - return int(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 annotation is int and rf and rf._format == "str": - return _deserialize_int_as_str - if rf and rf._format: - return _DESERIALIZE_MAPPING_WITHFORMAT.get(rf._format) - return _DESERIALIZE_MAPPING.get(annotation) # pyright: ignore - - -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]: - """ - :returns: a set-like object providing a view on D's keys - :rtype: ~typing.KeysView - """ - return self._data.keys() - - def values(self) -> typing.ValuesView[typing.Any]: - """ - :returns: an object providing a view on D's values - :rtype: ~typing.ValuesView - """ - return self._data.values() - - def items(self) -> typing.ItemsView[str, typing.Any]: - """ - :returns: set-like object providing a view on D's items - :rtype: ~typing.ItemsView - """ - return self._data.items() - - def get(self, key: str, default: typing.Any = None) -> typing.Any: - """ - Get the value for key if key is in the dictionary, else default. - :param str key: The key to look up. - :param any default: The value to return if key is not in the dictionary. Defaults to None - :returns: D[k] if k in D, else d. - :rtype: 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: - """ - Removes specified key and return the corresponding value. - :param str key: The key to pop. - :param any default: The value to return if key is not in the dictionary - :returns: The value corresponding to the key. - :rtype: any - :raises KeyError: If key is not found and default is not given. - """ - if default is _UNSET: - return self._data.pop(key) - return self._data.pop(key, default) - - def popitem(self) -> typing.Tuple[str, typing.Any]: - """ - Removes and returns some (key, value) pair - :returns: The (key, value) pair. - :rtype: tuple - :raises KeyError: if D is empty. - """ - return self._data.popitem() - - def clear(self) -> None: - """ - Remove all items from D. - """ - self._data.clear() - - def update(self, *args: typing.Any, **kwargs: typing.Any) -> None: - """ - Updates D from mapping/iterable E and F. - :param any args: Either a mapping object or an iterable of key-value pairs. - """ - 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: - """ - Same as calling D.get(k, d), and setting D[k]=d if k not found - :param str key: The key to look up. - :param any default: The value to set if key is not in the dictionary - :returns: D[k] if k in D, else d. - :rtype: 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) - if isinstance(value, ET.Element): - value = _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: # pylint: disable=too-many-nested-blocks - if isinstance(args[0], ET.Element): - existed_attr_keys = [] - model_meta = getattr(self, "_xml", {}) - - for rf in self._attr_to_rest_field.values(): - prop_meta = getattr(rf, "_xml", {}) - xml_name = prop_meta.get("name", rf._rest_name) - xml_ns = prop_meta.get("ns", model_meta.get("ns", None)) - if xml_ns: - xml_name = "{" + xml_ns + "}" + xml_name - - # attribute - if prop_meta.get("attribute", False) and args[0].get(xml_name) is not None: - existed_attr_keys.append(xml_name) - dict_to_pass[rf._rest_name] = _deserialize(rf._type, args[0].get(xml_name)) - continue - - # unwrapped element is array - if prop_meta.get("unwrapped", False): - # unwrapped array could either use prop items meta/prop meta - if prop_meta.get("itemsName"): - xml_name = prop_meta.get("itemsName") - xml_ns = prop_meta.get("itemNs") - if xml_ns: - xml_name = "{" + xml_ns + "}" + xml_name - items = args[0].findall(xml_name) # pyright: ignore - if len(items) > 0: - existed_attr_keys.append(xml_name) - dict_to_pass[rf._rest_name] = _deserialize(rf._type, items) - continue - - # text element is primitive type - if prop_meta.get("text", False): - if args[0].text is not None: - dict_to_pass[rf._rest_name] = _deserialize(rf._type, args[0].text) - continue - - # wrapped element could be normal property or array, it should only have one element - item = args[0].find(xml_name) - if item is not None: - existed_attr_keys.append(xml_name) - dict_to_pass[rf._rest_name] = _deserialize(rf._type, item) - - # rest thing is additional properties - for e in args[0]: - if e.tag not in existed_attr_keys: - dict_to_pass[e.tag] = _convert_element(e) - else: - 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: - 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__") - for k, v in mro_class.__annotations__.items() - } - 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__"): - base.__mapping__[discriminator or cls.__name__] = cls # type: ignore - - @classmethod - def _get_discriminator(cls, exist_discriminators) -> typing.Optional["_RestField"]: - for v in cls.__dict__.values(): - if isinstance(v, _RestField) and v._is_discriminator and v._rest_name not in exist_discriminators: - return v - return None - - @classmethod - def _deserialize(cls, data, exist_discriminators): - if not hasattr(cls, "__mapping__"): - return cls(data) - discriminator = cls._get_discriminator(exist_discriminators) - if discriminator is None: - return cls(data) - exist_discriminators.append(discriminator._rest_name) - if isinstance(data, ET.Element): - model_meta = getattr(cls, "_xml", {}) - prop_meta = getattr(discriminator, "_xml", {}) - xml_name = prop_meta.get("name", discriminator._rest_name) - xml_ns = prop_meta.get("ns", model_meta.get("ns", None)) - if xml_ns: - xml_name = "{" + xml_ns + "}" + xml_name - - if data.get(xml_name) is not None: - discriminator_value = data.get(xml_name) - else: - discriminator_value = data.find(xml_name).text # pyright: ignore - else: - discriminator_value = data.get(discriminator._rest_name) - mapped_cls = cls.__mapping__.get(discriminator_value, cls) # pyright: ignore - return mapped_cls._deserialize(data, exist_discriminators) - - def as_dict(self, *, exclude_readonly: bool = False) -> typing.Dict[str, typing.Any]: - """Return a dict that can be turned into json 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 - if isinstance(obj, ET.Element): - obj = {child.tag: child for child in 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 - if isinstance(obj, ET.Element): - obj = list(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=too-many-return-statements, too-many-branches - annotation: typing.Any, - module: typing.Optional[str], - rf: typing.Optional["_RestField"] = None, -) -> typing.Optional[typing.Callable[[typing.Any], typing.Any]]: - if not annotation: - 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) # type: ignore - - 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, -): # pylint: disable=too-many-return-statements - try: - if value is None or isinstance(value, _Null): - return None - if isinstance(value, ET.Element): - if deserializer is str: - return value.text or "" - if deserializer is int: - return int(value.text) if value.text else None - if deserializer is float: - return float(value.text) if value.text else None - if deserializer is bool: - return value.text == "true" if value.text else None - if deserializer is None: - return value - if deserializer in [int, float, bool]: - return deserializer(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) - - -def _failsafe_deserialize( - deserializer: typing.Any, - value: typing.Any, - module: typing.Optional[str] = None, - rf: typing.Optional["_RestField"] = None, - format: typing.Optional[str] = None, -) -> typing.Any: - try: - return _deserialize(deserializer, value, module, rf, format) - except DeserializationError: - _LOGGER.warning( - "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True - ) - return None - - -def _failsafe_deserialize_xml( - deserializer: typing.Any, - value: typing.Any, -) -> typing.Any: - try: - return _deserialize_xml(deserializer, value) - except DeserializationError: - _LOGGER.warning( - "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True - ) - return None - - -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, - xml: typing.Optional[typing.Dict[str, typing.Any]] = None, - ): - 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 - self._xml = xml if xml is not None else {} - - @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, - xml: typing.Optional[typing.Dict[str, typing.Any]] = None, -) -> typing.Any: - return _RestField( - name=name, - type=type, - visibility=visibility, - default=default, - format=format, - is_multipart_file_input=is_multipart_file_input, - xml=xml, - ) - - -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, - xml: typing.Optional[typing.Dict[str, typing.Any]] = None, -) -> typing.Any: - return _RestField(name=name, type=type, is_discriminator=True, visibility=visibility, xml=xml) - - -def serialize_xml(model: Model, exclude_readonly: bool = False) -> str: - """Serialize a model to XML. - - :param Model model: The model to serialize. - :param bool exclude_readonly: Whether to exclude readonly properties. - :returns: The XML representation of the model. - :rtype: str - """ - return ET.tostring(_get_element(model, exclude_readonly), encoding="unicode") # type: ignore - - -def _get_element( - o: typing.Any, - exclude_readonly: bool = False, - parent_meta: typing.Optional[typing.Dict[str, typing.Any]] = None, - wrapped_element: typing.Optional[ET.Element] = None, -) -> typing.Union[ET.Element, typing.List[ET.Element]]: - if _is_model(o): - model_meta = getattr(o, "_xml", {}) - - # if prop is a model, then use the prop element directly, else generate a wrapper of model - if wrapped_element is None: - wrapped_element = _create_xml_element( - model_meta.get("name", o.__class__.__name__), - model_meta.get("prefix"), - model_meta.get("ns"), - ) - - readonly_props = [] - if exclude_readonly: - readonly_props = [p._rest_name for p in o._attr_to_rest_field.values() if _is_readonly(p)] - - for k, v in o.items(): - # do not serialize readonly properties - if exclude_readonly and k in readonly_props: - continue - - prop_rest_field = _get_rest_field(o._attr_to_rest_field, k) - if prop_rest_field: - prop_meta = getattr(prop_rest_field, "_xml").copy() - # use the wire name as xml name if no specific name is set - if prop_meta.get("name") is None: - prop_meta["name"] = k - else: - # additional properties will not have rest field, use the wire name as xml name - prop_meta = {"name": k} - - # if no ns for prop, use model's - if prop_meta.get("ns") is None and model_meta.get("ns"): - prop_meta["ns"] = model_meta.get("ns") - prop_meta["prefix"] = model_meta.get("prefix") - - if prop_meta.get("unwrapped", False): - # unwrapped could only set on array - wrapped_element.extend(_get_element(v, exclude_readonly, prop_meta)) - elif prop_meta.get("text", False): - # text could only set on primitive type - wrapped_element.text = _get_primitive_type_value(v) - elif prop_meta.get("attribute", False): - xml_name = prop_meta.get("name", k) - if prop_meta.get("ns"): - ET.register_namespace(prop_meta.get("prefix"), prop_meta.get("ns")) # pyright: ignore - xml_name = "{" + prop_meta.get("ns") + "}" + xml_name # pyright: ignore - # attribute should be primitive type - wrapped_element.set(xml_name, _get_primitive_type_value(v)) - else: - # other wrapped prop element - wrapped_element.append(_get_wrapped_element(v, exclude_readonly, prop_meta)) - return wrapped_element - if isinstance(o, list): - return [_get_element(x, exclude_readonly, parent_meta) for x in o] # type: ignore - if isinstance(o, dict): - result = [] - for k, v in o.items(): - result.append( - _get_wrapped_element( - v, - exclude_readonly, - { - "name": k, - "ns": parent_meta.get("ns") if parent_meta else None, - "prefix": parent_meta.get("prefix") if parent_meta else None, - }, - ) - ) - return result - - # primitive case need to create element based on parent_meta - if parent_meta: - return _get_wrapped_element( - o, - exclude_readonly, - { - "name": parent_meta.get("itemsName", parent_meta.get("name")), - "prefix": parent_meta.get("itemsPrefix", parent_meta.get("prefix")), - "ns": parent_meta.get("itemsNs", parent_meta.get("ns")), - }, - ) - - raise ValueError("Could not serialize value into xml: " + o) - - -def _get_wrapped_element( - v: typing.Any, - exclude_readonly: bool, - meta: typing.Optional[typing.Dict[str, typing.Any]], -) -> ET.Element: - wrapped_element = _create_xml_element( - meta.get("name") if meta else None, meta.get("prefix") if meta else None, meta.get("ns") if meta else None - ) - if isinstance(v, (dict, list)): - wrapped_element.extend(_get_element(v, exclude_readonly, meta)) - elif _is_model(v): - _get_element(v, exclude_readonly, meta, wrapped_element) - else: - wrapped_element.text = _get_primitive_type_value(v) - return wrapped_element - - -def _get_primitive_type_value(v) -> str: - if v is True: - return "true" - if v is False: - return "false" - if isinstance(v, _Null): - return "" - return str(v) - - -def _create_xml_element(tag, prefix=None, ns=None): - if prefix and ns: - ET.register_namespace(prefix, ns) - if ns: - return ET.Element("{" + ns + "}" + tag) - return ET.Element(tag) - - -def _deserialize_xml( - deserializer: typing.Any, - value: str, -) -> typing.Any: - element = ET.fromstring(value) # nosec - return _deserialize(deserializer, element) - - -def _convert_element(e: ET.Element): - # dict case - if len(e.attrib) > 0 or len({child.tag for child in e}) > 1: - dict_result: typing.Dict[str, typing.Any] = {} - for child in e: - if dict_result.get(child.tag) is not None: - if isinstance(dict_result[child.tag], list): - dict_result[child.tag].append(_convert_element(child)) - else: - dict_result[child.tag] = [dict_result[child.tag], _convert_element(child)] - else: - dict_result[child.tag] = _convert_element(child) - dict_result.update(e.attrib) - return dict_result - # array case - if len(e) > 0: - array_result: typing.List[typing.Any] = [] - for child in e: - array_result.append(_convert_element(child)) - return array_result - # primitive case - return e.text diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_operations/__init__.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_operations/__init__.py deleted file mode 100644 index 4a8ff7f9c39..00000000000 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_operations/__init__.py +++ /dev/null @@ -1,19 +0,0 @@ -# coding=utf-8 -# pylint: disable=wrong-import-position - -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from ._patch import * # pylint: disable=unused-wildcard-import - -from ._operations import ResiliencyServiceDrivenClientOperationsMixin # type: ignore - -from ._patch import __all__ as _patch_all -from ._patch import * -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "ResiliencyServiceDrivenClientOperationsMixin", -] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore -_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_operations/_operations.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_operations/_operations.py deleted file mode 100644 index 22876d36a34..00000000000 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_operations/_operations.py +++ /dev/null @@ -1,228 +0,0 @@ -# coding=utf-8 -import sys -from typing import Any, Callable, Dict, Optional, 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 ResiliencyServiceDrivenClientMixinABC - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_resiliency_service_driven_from_none_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long - # Construct URL - _url = "/add-optional-param/from-none" - - return HttpRequest(method="HEAD", url=_url, **kwargs) - - -def build_resiliency_service_driven_from_one_required_request( # pylint: disable=name-too-long - *, parameter: str, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - # Construct URL - _url = "/add-optional-param/from-one-required" - - # Construct parameters - _params["parameter"] = _SERIALIZER.query("parameter", parameter, "str") - - return HttpRequest(method="GET", url=_url, params=_params, **kwargs) - - -def build_resiliency_service_driven_from_one_optional_request( # pylint: disable=name-too-long - *, parameter: Optional[str] = None, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - # Construct URL - _url = "/add-optional-param/from-one-optional" - - # Construct parameters - if parameter is not None: - _params["parameter"] = _SERIALIZER.query("parameter", parameter, "str") - - return HttpRequest(method="GET", url=_url, params=_params, **kwargs) - - -class ResiliencyServiceDrivenClientOperationsMixin( # pylint: disable=name-too-long - ResiliencyServiceDrivenClientMixinABC -): - - @distributed_trace - def from_none(self, **kwargs: Any) -> bool: - """Test that currently accepts no parameters, will be updated in next spec to accept a new - optional parameter as well. - - :return: bool - :rtype: bool - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_resiliency_service_driven_from_none_request( - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - "serviceDeploymentVersion": self._serialize.url( - "self._config.service_deployment_version", self._config.service_deployment_version, "str" - ), - "apiVersion": self._serialize.url("self._config.api_version", self._config.api_version, "str"), - } - _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 from_one_required( # pylint: disable=inconsistent-return-statements - self, *, parameter: str, **kwargs: Any - ) -> None: - """Test that currently accepts one required parameter, will be updated in next spec to accept a - new optional parameter as well. - - :keyword parameter: I am a required parameter. Required. - :paramtype parameter: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_resiliency_service_driven_from_one_required_request( - parameter=parameter, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - "serviceDeploymentVersion": self._serialize.url( - "self._config.service_deployment_version", self._config.service_deployment_version, "str" - ), - "apiVersion": self._serialize.url("self._config.api_version", self._config.api_version, "str"), - } - _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 from_one_optional( # pylint: disable=inconsistent-return-statements - self, *, parameter: Optional[str] = None, **kwargs: Any - ) -> None: - """Test that currently accepts one optional parameter, will be updated in next spec to accept a - new optional parameter as well. - - :keyword parameter: I am an optional parameter. Default value is None. - :paramtype parameter: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_resiliency_service_driven_from_one_optional_request( - parameter=parameter, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - "serviceDeploymentVersion": self._serialize.url( - "self._config.service_deployment_version", self._config.service_deployment_version, "str" - ), - "apiVersion": self._serialize.url("self._config.api_version", self._config.api_version, "str"), - } - _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/resiliency-srv-driven1/resiliency/srv/driven1/_operations/_patch.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_operations/_patch.py deleted file mode 100644 index 8bcb627aa47..00000000000 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_operations/_patch.py +++ /dev/null @@ -1,21 +0,0 @@ -# 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. -# -------------------------------------------------------------------------- -"""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/resiliency-srv-driven1/resiliency/srv/driven1/_patch.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_patch.py deleted file mode 100644 index 8bcb627aa47..00000000000 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_patch.py +++ /dev/null @@ -1,21 +0,0 @@ -# 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. -# -------------------------------------------------------------------------- -"""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/resiliency-srv-driven1/resiliency/srv/driven1/_serialization.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_serialization.py deleted file mode 100644 index f71dbc0833e..00000000000 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_serialization.py +++ /dev/null @@ -1,2026 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression,too-many-lines -# coding=utf-8 - -# 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, - MutableMapping, - 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 typing_extensions import Self - -from azure.core.exceptions import DeserializationError, SerializationError -from azure.core.serialization import NULL as CoreNull - -_BOM = codecs.BOM_UTF8.decode(encoding="utf-8") - -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 - -TZ_UTC = datetime.timezone.utc - -_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, data: Any, content_type: Optional[str] = None) -> Self: - """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: Self - """ - deserializer = Deserializer(cls._infer_class_models()) - return deserializer(cls.__name__, data, content_type=content_type) # type: ignore - - @classmethod - def from_dict( - cls, - data: Any, - key_extractors: Optional[Callable[[str, Dict[str, Any], Any], Any]] = None, - content_type: Optional[str] = None, - ) -> Self: - """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: Self - """ - 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. - - :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.get(rest_api_response_key, None) or response.get(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: # 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) -> 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( - 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: - """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) -> 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() # pylint: disable=protected-access # type: ignore - if v.get("readonly") - ] - const = [ - k - for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore - if v.get("constant") - ] - 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 # type: ignore - 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=datetime.timezone(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/resiliency-srv-driven1/resiliency/srv/driven1/_vendor.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_vendor.py deleted file mode 100644 index a1f1bf8898a..00000000000 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_vendor.py +++ /dev/null @@ -1,18 +0,0 @@ -from abc import ABC -from typing import TYPE_CHECKING - -from ._configuration import ResiliencyServiceDrivenClientConfiguration - -if TYPE_CHECKING: - from azure.core import PipelineClient - - from ._serialization import Deserializer, Serializer - - -class ResiliencyServiceDrivenClientMixinABC(ABC): - """DO NOT use this class. It is for internal typing use only.""" - - _client: "PipelineClient" - _config: ResiliencyServiceDrivenClientConfiguration - _serialize: "Serializer" - _deserialize: "Deserializer" diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_version.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_version.py deleted file mode 100644 index 9f6458b8cda..00000000000 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_version.py +++ /dev/null @@ -1,3 +0,0 @@ -# coding=utf-8 - -VERSION = "1.0.0b1" diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/aio/__init__.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/aio/__init__.py deleted file mode 100644 index 4f41aabeaa2..00000000000 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/aio/__init__.py +++ /dev/null @@ -1,23 +0,0 @@ -# coding=utf-8 -# pylint: disable=wrong-import-position - -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from ._patch import * # pylint: disable=unused-wildcard-import - -from ._client import ResiliencyServiceDrivenClient # type: ignore - -try: - from ._patch import __all__ as _patch_all - from ._patch import * -except ImportError: - _patch_all = [] -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "ResiliencyServiceDrivenClient", -] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore - -_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/aio/_client.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/aio/_client.py deleted file mode 100644 index 6e5d7d32e1a..00000000000 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/aio/_client.py +++ /dev/null @@ -1,105 +0,0 @@ -# coding=utf-8 - -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 ResiliencyServiceDrivenClientConfiguration -from ._operations import ResiliencyServiceDrivenClientOperationsMixin - - -class ResiliencyServiceDrivenClient(ResiliencyServiceDrivenClientOperationsMixin): - """Test that we can grow up a service spec and service deployment into a multi-versioned service - with full client support. - - :param endpoint: Need to be set as '`http://localhost:3000 `_' in - client. Required. - :type endpoint: str - :param service_deployment_version: Pass in either 'v1' or 'v2'. This represents a version of - the service deployment in history. 'v1' is for the deployment when the service had only one api - version. 'v2' is for the deployment when the service had api-versions 'v1' and 'v2'. Required. - :type service_deployment_version: str - :keyword api_version: Pass in 'v1'. This represents the API version of the service. Will grow - up in the next deployment to be both 'v1' and 'v2'. Known values are "v1" and None. Default - value is "v1". Note that overriding this default value may result in unsupported behavior. - :paramtype api_version: str - """ - - def __init__( # pylint: disable=missing-client-constructor-parameter-credential - self, endpoint: str, service_deployment_version: str, **kwargs: Any - ) -> None: - _endpoint = ( - "{endpoint}/resiliency/service-driven/client:v1/service:{serviceDeploymentVersion}/api-version:{apiVersion}" - ) - self._config = ResiliencyServiceDrivenClientConfiguration( - endpoint=endpoint, service_deployment_version=service_deployment_version, **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 - - 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), - "serviceDeploymentVersion": self._serialize.url( - "self._config.service_deployment_version", self._config.service_deployment_version, "str" - ), - "apiVersion": self._serialize.url("self._config.api_version", self._config.api_version, "str"), - } - - 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/resiliency-srv-driven1/resiliency/srv/driven1/aio/_configuration.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/aio/_configuration.py deleted file mode 100644 index bce1e6a0cfc..00000000000 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/aio/_configuration.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding=utf-8 - -from typing import Any - -from azure.core.pipeline import policies - -from .._version import VERSION - - -class ResiliencyServiceDrivenClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long - """Configuration for ResiliencyServiceDrivenClient. - - Note that all parameters used to create this instance are saved as instance - attributes. - - :param endpoint: Need to be set as '`http://localhost:3000 `_' in - client. Required. - :type endpoint: str - :param service_deployment_version: Pass in either 'v1' or 'v2'. This represents a version of - the service deployment in history. 'v1' is for the deployment when the service had only one api - version. 'v2' is for the deployment when the service had api-versions 'v1' and 'v2'. Required. - :type service_deployment_version: str - :keyword api_version: Pass in 'v1'. This represents the API version of the service. Will grow - up in the next deployment to be both 'v1' and 'v2'. Known values are "v1" and None. Default - value is "v1". Note that overriding this default value may result in unsupported behavior. - :paramtype api_version: str - """ - - def __init__(self, endpoint: str, service_deployment_version: str, **kwargs: Any) -> None: - api_version: str = kwargs.pop("api_version", "v1") - - if endpoint is None: - raise ValueError("Parameter 'endpoint' must not be None.") - if service_deployment_version is None: - raise ValueError("Parameter 'service_deployment_version' must not be None.") - - self.endpoint = endpoint - self.service_deployment_version = service_deployment_version - self.api_version = api_version - kwargs.setdefault("sdk_moniker", "resiliency-srv-driven1/{}".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/resiliency-srv-driven1/resiliency/srv/driven1/aio/_operations/__init__.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/aio/_operations/__init__.py deleted file mode 100644 index 4a8ff7f9c39..00000000000 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/aio/_operations/__init__.py +++ /dev/null @@ -1,19 +0,0 @@ -# coding=utf-8 -# pylint: disable=wrong-import-position - -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from ._patch import * # pylint: disable=unused-wildcard-import - -from ._operations import ResiliencyServiceDrivenClientOperationsMixin # type: ignore - -from ._patch import __all__ as _patch_all -from ._patch import * -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "ResiliencyServiceDrivenClientOperationsMixin", -] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore -_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/aio/_operations/_operations.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/aio/_operations/_operations.py deleted file mode 100644 index b73e81158c7..00000000000 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/aio/_operations/_operations.py +++ /dev/null @@ -1,189 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# coding=utf-8 -import sys -from typing import Any, Callable, Dict, Optional, 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_resiliency_service_driven_from_none_request, - build_resiliency_service_driven_from_one_optional_request, - build_resiliency_service_driven_from_one_required_request, -) -from .._vendor import ResiliencyServiceDrivenClientMixinABC - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class ResiliencyServiceDrivenClientOperationsMixin( # pylint: disable=name-too-long - ResiliencyServiceDrivenClientMixinABC -): - - @distributed_trace_async - async def from_none(self, **kwargs: Any) -> bool: - """Test that currently accepts no parameters, will be updated in next spec to accept a new - optional parameter as well. - - :return: bool - :rtype: bool - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_resiliency_service_driven_from_none_request( - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - "serviceDeploymentVersion": self._serialize.url( - "self._config.service_deployment_version", self._config.service_deployment_version, "str" - ), - "apiVersion": self._serialize.url("self._config.api_version", self._config.api_version, "str"), - } - _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 from_one_required(self, *, parameter: str, **kwargs: Any) -> None: - """Test that currently accepts one required parameter, will be updated in next spec to accept a - new optional parameter as well. - - :keyword parameter: I am a required parameter. Required. - :paramtype parameter: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_resiliency_service_driven_from_one_required_request( - parameter=parameter, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - "serviceDeploymentVersion": self._serialize.url( - "self._config.service_deployment_version", self._config.service_deployment_version, "str" - ), - "apiVersion": self._serialize.url("self._config.api_version", self._config.api_version, "str"), - } - _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 - - @distributed_trace_async - async def from_one_optional(self, *, parameter: Optional[str] = None, **kwargs: Any) -> None: - """Test that currently accepts one optional parameter, will be updated in next spec to accept a - new optional parameter as well. - - :keyword parameter: I am an optional parameter. Default value is None. - :paramtype parameter: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_resiliency_service_driven_from_one_optional_request( - parameter=parameter, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - "serviceDeploymentVersion": self._serialize.url( - "self._config.service_deployment_version", self._config.service_deployment_version, "str" - ), - "apiVersion": self._serialize.url("self._config.api_version", self._config.api_version, "str"), - } - _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/resiliency-srv-driven1/resiliency/srv/driven1/aio/_operations/_patch.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/aio/_operations/_patch.py deleted file mode 100644 index 8bcb627aa47..00000000000 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/aio/_operations/_patch.py +++ /dev/null @@ -1,21 +0,0 @@ -# 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. -# -------------------------------------------------------------------------- -"""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/resiliency-srv-driven1/resiliency/srv/driven1/aio/_patch.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/aio/_patch.py deleted file mode 100644 index 8bcb627aa47..00000000000 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/aio/_patch.py +++ /dev/null @@ -1,21 +0,0 @@ -# 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. -# -------------------------------------------------------------------------- -"""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/resiliency-srv-driven1/resiliency/srv/driven1/aio/_vendor.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/aio/_vendor.py deleted file mode 100644 index a683c047d98..00000000000 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/aio/_vendor.py +++ /dev/null @@ -1,18 +0,0 @@ -from abc import ABC -from typing import TYPE_CHECKING - -from ._configuration import ResiliencyServiceDrivenClientConfiguration - -if TYPE_CHECKING: - from azure.core import AsyncPipelineClient - - from .._serialization import Deserializer, Serializer - - -class ResiliencyServiceDrivenClientMixinABC(ABC): - """DO NOT use this class. It is for internal typing use only.""" - - _client: "AsyncPipelineClient" - _config: ResiliencyServiceDrivenClientConfiguration - _serialize: "Serializer" - _deserialize: "Deserializer" diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/py.typed b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/py.typed deleted file mode 100644 index e5aff4f83af..00000000000 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/py.typed +++ /dev/null @@ -1 +0,0 @@ -# Marker file for PEP 561. \ No newline at end of file diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/setup.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/setup.py deleted file mode 100644 index 00cdce19581..00000000000 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/setup.py +++ /dev/null @@ -1,65 +0,0 @@ -# coding=utf-8 - - -import os -import re -from setuptools import setup, find_packages - - -PACKAGE_NAME = "resiliency-srv-driven1" -PACKAGE_PPRINT_NAME = "ResiliencySrvDriven1" - -# 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 Corporation {} 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", - # Exclude packages that will be covered by PEP420 or nspkg - "resiliency", - "resiliency.srv", - ] - ), - include_package_data=True, - package_data={ - "resiliency.srv.driven1": ["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/resiliency-srv-driven2/CHANGELOG.md b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/CHANGELOG.md deleted file mode 100644 index 628743d283a..00000000000 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/CHANGELOG.md +++ /dev/null @@ -1,5 +0,0 @@ -# Release History - -## 1.0.0b1 (1970-01-01) - -- Initial version diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/LICENSE b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/LICENSE deleted file mode 100644 index 63447fd8bbb..00000000000 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -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/resiliency-srv-driven2/MANIFEST.in b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/MANIFEST.in deleted file mode 100644 index 22e737be264..00000000000 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/MANIFEST.in +++ /dev/null @@ -1,7 +0,0 @@ -include *.md -include LICENSE -include resiliency/srv/driven2/py.typed -recursive-include tests *.py -recursive-include samples *.py *.md -include resiliency/__init__.py -include resiliency/srv/__init__.py diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/README.md b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/README.md deleted file mode 100644 index 18f39c6183d..00000000000 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/README.md +++ /dev/null @@ -1,43 +0,0 @@ -# ResiliencySrvDriven2 client library for Python - - -## Getting started - -### Install the package - -```bash -python -m pip install resiliency-srv-driven2 -``` - -#### 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 ResiliencySrvDriven2 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/resiliency-srv-driven2/apiview-properties.json b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/apiview-properties.json deleted file mode 100644 index f1c922a67a2..00000000000 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/apiview-properties.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "CrossLanguagePackageId": "Resiliency.ServiceDriven", - "CrossLanguageDefinitionId": { - "resiliency.srv.driven2.ResiliencyServiceDrivenClient.add_operation": "Resiliency.ServiceDriven.addOperation", - "resiliency.srv.driven2.ResiliencyServiceDrivenClient.from_none": "Resiliency.ServiceDriven.AddOptionalParam.fromNone", - "resiliency.srv.driven2.ResiliencyServiceDrivenClient.from_one_required": "Resiliency.ServiceDriven.AddOptionalParam.fromOneRequired", - "resiliency.srv.driven2.ResiliencyServiceDrivenClient.from_one_optional": "Resiliency.ServiceDriven.AddOptionalParam.fromOneOptional" - } -} \ No newline at end of file diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/dev_requirements.txt b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/dev_requirements.txt deleted file mode 100644 index 10548647144..00000000000 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/dev_requirements.txt +++ /dev/null @@ -1,3 +0,0 @@ --e ../../../tools/azure-sdk-tools -../../core/azure-core -aiohttp \ No newline at end of file diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/generated_tests/conftest.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/generated_tests/conftest.py deleted file mode 100644 index a8b02f1c29e..00000000000 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/generated_tests/conftest.py +++ /dev/null @@ -1,41 +0,0 @@ -# coding=utf-8 -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() - - -# For security, please avoid record sensitive identity information in recordings -@pytest.fixture(scope="session", autouse=True) -def add_sanitizers(test_proxy): - resiliencyservicedriven_subscription_id = os.environ.get( - "RESILIENCYSERVICEDRIVEN_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000" - ) - resiliencyservicedriven_tenant_id = os.environ.get( - "RESILIENCYSERVICEDRIVEN_TENANT_ID", "00000000-0000-0000-0000-000000000000" - ) - resiliencyservicedriven_client_id = os.environ.get( - "RESILIENCYSERVICEDRIVEN_CLIENT_ID", "00000000-0000-0000-0000-000000000000" - ) - resiliencyservicedriven_client_secret = os.environ.get( - "RESILIENCYSERVICEDRIVEN_CLIENT_SECRET", "00000000-0000-0000-0000-000000000000" - ) - add_general_regex_sanitizer( - regex=resiliencyservicedriven_subscription_id, value="00000000-0000-0000-0000-000000000000" - ) - add_general_regex_sanitizer(regex=resiliencyservicedriven_tenant_id, value="00000000-0000-0000-0000-000000000000") - add_general_regex_sanitizer(regex=resiliencyservicedriven_client_id, value="00000000-0000-0000-0000-000000000000") - add_general_regex_sanitizer( - regex=resiliencyservicedriven_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/resiliency-srv-driven2/generated_tests/test_resiliency_service_driven.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/generated_tests/test_resiliency_service_driven.py deleted file mode 100644 index 69fac02b913..00000000000 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/generated_tests/test_resiliency_service_driven.py +++ /dev/null @@ -1,45 +0,0 @@ -# coding=utf-8 -import pytest -from devtools_testutils import recorded_by_proxy -from testpreparer import ResiliencyServiceDrivenClientTestBase, ResiliencyServiceDrivenPreparer - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestResiliencyServiceDriven(ResiliencyServiceDrivenClientTestBase): - @ResiliencyServiceDrivenPreparer() - @recorded_by_proxy - def test_add_operation(self, resiliencyservicedriven_endpoint): - client = self.create_client(endpoint=resiliencyservicedriven_endpoint) - response = client.add_operation() - - # please add some check logic here by yourself - # ... - - @ResiliencyServiceDrivenPreparer() - @recorded_by_proxy - def test_from_none(self, resiliencyservicedriven_endpoint): - client = self.create_client(endpoint=resiliencyservicedriven_endpoint) - response = client.from_none() - - # please add some check logic here by yourself - # ... - - @ResiliencyServiceDrivenPreparer() - @recorded_by_proxy - def test_from_one_required(self, resiliencyservicedriven_endpoint): - client = self.create_client(endpoint=resiliencyservicedriven_endpoint) - response = client.from_one_required( - parameter="str", - ) - - # please add some check logic here by yourself - # ... - - @ResiliencyServiceDrivenPreparer() - @recorded_by_proxy - def test_from_one_optional(self, resiliencyservicedriven_endpoint): - client = self.create_client(endpoint=resiliencyservicedriven_endpoint) - response = client.from_one_optional() - - # please add some check logic here by yourself - # ... diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/generated_tests/test_resiliency_service_driven_async.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/generated_tests/test_resiliency_service_driven_async.py deleted file mode 100644 index 3428f5f7036..00000000000 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/generated_tests/test_resiliency_service_driven_async.py +++ /dev/null @@ -1,46 +0,0 @@ -# coding=utf-8 -import pytest -from devtools_testutils.aio import recorded_by_proxy_async -from testpreparer import ResiliencyServiceDrivenPreparer -from testpreparer_async import ResiliencyServiceDrivenClientTestBaseAsync - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestResiliencyServiceDrivenAsync(ResiliencyServiceDrivenClientTestBaseAsync): - @ResiliencyServiceDrivenPreparer() - @recorded_by_proxy_async - async def test_add_operation(self, resiliencyservicedriven_endpoint): - client = self.create_async_client(endpoint=resiliencyservicedriven_endpoint) - response = await client.add_operation() - - # please add some check logic here by yourself - # ... - - @ResiliencyServiceDrivenPreparer() - @recorded_by_proxy_async - async def test_from_none(self, resiliencyservicedriven_endpoint): - client = self.create_async_client(endpoint=resiliencyservicedriven_endpoint) - response = await client.from_none() - - # please add some check logic here by yourself - # ... - - @ResiliencyServiceDrivenPreparer() - @recorded_by_proxy_async - async def test_from_one_required(self, resiliencyservicedriven_endpoint): - client = self.create_async_client(endpoint=resiliencyservicedriven_endpoint) - response = await client.from_one_required( - parameter="str", - ) - - # please add some check logic here by yourself - # ... - - @ResiliencyServiceDrivenPreparer() - @recorded_by_proxy_async - async def test_from_one_optional(self, resiliencyservicedriven_endpoint): - client = self.create_async_client(endpoint=resiliencyservicedriven_endpoint) - response = await client.from_one_optional() - - # please add some check logic here by yourself - # ... diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/generated_tests/testpreparer.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/generated_tests/testpreparer.py deleted file mode 100644 index 4b27b01cbbd..00000000000 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/generated_tests/testpreparer.py +++ /dev/null @@ -1,22 +0,0 @@ -# coding=utf-8 -from devtools_testutils import AzureRecordedTestCase, PowerShellPreparer -import functools -from resiliency.srv.driven2 import ResiliencyServiceDrivenClient - - -class ResiliencyServiceDrivenClientTestBase(AzureRecordedTestCase): - - def create_client(self, endpoint): - credential = self.get_credential(ResiliencyServiceDrivenClient) - return self.create_client_from_credential( - ResiliencyServiceDrivenClient, - credential=credential, - endpoint=endpoint, - ) - - -ResiliencyServiceDrivenPreparer = functools.partial( - PowerShellPreparer, - "resiliencyservicedriven", - resiliencyservicedriven_endpoint="https://fake_resiliencyservicedriven_endpoint.com", -) diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/generated_tests/testpreparer_async.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/generated_tests/testpreparer_async.py deleted file mode 100644 index 8d5fdf72038..00000000000 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/generated_tests/testpreparer_async.py +++ /dev/null @@ -1,14 +0,0 @@ -# coding=utf-8 -from devtools_testutils import AzureRecordedTestCase -from resiliency.srv.driven2.aio import ResiliencyServiceDrivenClient - - -class ResiliencyServiceDrivenClientTestBaseAsync(AzureRecordedTestCase): - - def create_async_client(self, endpoint): - credential = self.get_credential(ResiliencyServiceDrivenClient, is_async=True) - return self.create_client_from_credential( - ResiliencyServiceDrivenClient, - credential=credential, - endpoint=endpoint, - ) diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/__init__.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/__init__.py deleted file mode 100644 index d55ccad1f57..00000000000 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/__init__.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/__init__.py deleted file mode 100644 index d55ccad1f57..00000000000 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/__init__.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/__init__.py deleted file mode 100644 index 777f7bc99dd..00000000000 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/__init__.py +++ /dev/null @@ -1,26 +0,0 @@ -# coding=utf-8 -# pylint: disable=wrong-import-position - -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from ._patch import * # pylint: disable=unused-wildcard-import - -from ._client import ResiliencyServiceDrivenClient # type: ignore -from ._version import VERSION - -__version__ = VERSION - -try: - from ._patch import __all__ as _patch_all - from ._patch import * -except ImportError: - _patch_all = [] -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "ResiliencyServiceDrivenClient", -] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore - -_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_client.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_client.py deleted file mode 100644 index 7000678cf9f..00000000000 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_client.py +++ /dev/null @@ -1,120 +0,0 @@ -# coding=utf-8 - -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 ResiliencyServiceDrivenClientConfiguration -from ._operations import ResiliencyServiceDrivenClientOperationsMixin -from ._serialization import Deserializer, Serializer - - -class ResiliencyServiceDrivenClient(ResiliencyServiceDrivenClientOperationsMixin): - """Test that we can grow up a service spec and service deployment into a multi-versioned service - with full client support. - - There are three concepts that should be clarified: - - 1. Client spec version: refers to the spec that the client is generated from. 'v1' is a client - generated from old.tsp and 'v2' is a client generated from main.tsp. - 2. Service deployment version: refers to a deployment version of the service. 'v1' represents - the initial deployment of the service with a single api version. 'v2' represents the new - deployment of a service with multiple api versions - 3. Api version: The initial deployment of the service only supports api version 'v1'. The new - deployment of the service supports api versions 'v1' and 'v2'. - - We test the following configurations from this service spec: - - * A client generated from the second service spec can call the second deployment of a service - with api version v1 - * A client generated from the second service spec can call the second deployment of a service - with api version v2. - - :param endpoint: Need to be set as '`http://localhost:3000 `_' in - client. Required. - :type endpoint: str - :param service_deployment_version: Pass in either 'v1' or 'v2'. This represents a version of - the service deployment in history. 'v1' is for the deployment when the service had only one api - version. 'v2' is for the deployment when the service had api-versions 'v1' and 'v2'. Required. - :type service_deployment_version: str - :keyword api_version: Pass in either 'v1' or 'v2'. This represents the API version of a - service. Known values are "v2" and None. Default value is "v2". Note that overriding this - default value may result in unsupported behavior. - :paramtype api_version: str - """ - - def __init__( # pylint: disable=missing-client-constructor-parameter-credential - self, endpoint: str, service_deployment_version: str, **kwargs: Any - ) -> None: - _endpoint = ( - "{endpoint}/resiliency/service-driven/client:v2/service:{serviceDeploymentVersion}/api-version:{apiVersion}" - ) - self._config = ResiliencyServiceDrivenClientConfiguration( - endpoint=endpoint, service_deployment_version=service_deployment_version, **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 - - 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), - "serviceDeploymentVersion": self._serialize.url( - "self._config.service_deployment_version", self._config.service_deployment_version, "str" - ), - "apiVersion": self._serialize.url("self._config.api_version", self._config.api_version, "str"), - } - - 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/resiliency-srv-driven2/resiliency/srv/driven2/_configuration.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_configuration.py deleted file mode 100644 index cf1da010fe0..00000000000 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_configuration.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding=utf-8 - -from typing import Any - -from azure.core.pipeline import policies - -from ._version import VERSION - - -class ResiliencyServiceDrivenClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long - """Configuration for ResiliencyServiceDrivenClient. - - Note that all parameters used to create this instance are saved as instance - attributes. - - :param endpoint: Need to be set as '`http://localhost:3000 `_' in - client. Required. - :type endpoint: str - :param service_deployment_version: Pass in either 'v1' or 'v2'. This represents a version of - the service deployment in history. 'v1' is for the deployment when the service had only one api - version. 'v2' is for the deployment when the service had api-versions 'v1' and 'v2'. Required. - :type service_deployment_version: str - :keyword api_version: Pass in either 'v1' or 'v2'. This represents the API version of a - service. Known values are "v2" and None. Default value is "v2". Note that overriding this - default value may result in unsupported behavior. - :paramtype api_version: str - """ - - def __init__(self, endpoint: str, service_deployment_version: str, **kwargs: Any) -> None: - api_version: str = kwargs.pop("api_version", "v2") - - if endpoint is None: - raise ValueError("Parameter 'endpoint' must not be None.") - if service_deployment_version is None: - raise ValueError("Parameter 'service_deployment_version' must not be None.") - - self.endpoint = endpoint - self.service_deployment_version = service_deployment_version - self.api_version = api_version - kwargs.setdefault("sdk_moniker", "resiliency-srv-driven2/{}".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/resiliency-srv-driven2/resiliency/srv/driven2/_model_base.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_model_base.py deleted file mode 100644 index e8ecb270bd8..00000000000 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_model_base.py +++ /dev/null @@ -1,1230 +0,0 @@ -# pylint: disable=too-many-lines -# coding=utf-8 -# pylint: disable=protected-access, 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 -import xml.etree.ElementTree as ET -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"] - 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)) - - -def _deserialize_int_as_str(attr): - if isinstance(attr, int): - return attr - return int(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 annotation is int and rf and rf._format == "str": - return _deserialize_int_as_str - if rf and rf._format: - return _DESERIALIZE_MAPPING_WITHFORMAT.get(rf._format) - return _DESERIALIZE_MAPPING.get(annotation) # pyright: ignore - - -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]: - """ - :returns: a set-like object providing a view on D's keys - :rtype: ~typing.KeysView - """ - return self._data.keys() - - def values(self) -> typing.ValuesView[typing.Any]: - """ - :returns: an object providing a view on D's values - :rtype: ~typing.ValuesView - """ - return self._data.values() - - def items(self) -> typing.ItemsView[str, typing.Any]: - """ - :returns: set-like object providing a view on D's items - :rtype: ~typing.ItemsView - """ - return self._data.items() - - def get(self, key: str, default: typing.Any = None) -> typing.Any: - """ - Get the value for key if key is in the dictionary, else default. - :param str key: The key to look up. - :param any default: The value to return if key is not in the dictionary. Defaults to None - :returns: D[k] if k in D, else d. - :rtype: 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: - """ - Removes specified key and return the corresponding value. - :param str key: The key to pop. - :param any default: The value to return if key is not in the dictionary - :returns: The value corresponding to the key. - :rtype: any - :raises KeyError: If key is not found and default is not given. - """ - if default is _UNSET: - return self._data.pop(key) - return self._data.pop(key, default) - - def popitem(self) -> typing.Tuple[str, typing.Any]: - """ - Removes and returns some (key, value) pair - :returns: The (key, value) pair. - :rtype: tuple - :raises KeyError: if D is empty. - """ - return self._data.popitem() - - def clear(self) -> None: - """ - Remove all items from D. - """ - self._data.clear() - - def update(self, *args: typing.Any, **kwargs: typing.Any) -> None: - """ - Updates D from mapping/iterable E and F. - :param any args: Either a mapping object or an iterable of key-value pairs. - """ - 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: - """ - Same as calling D.get(k, d), and setting D[k]=d if k not found - :param str key: The key to look up. - :param any default: The value to set if key is not in the dictionary - :returns: D[k] if k in D, else d. - :rtype: 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) - if isinstance(value, ET.Element): - value = _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: # pylint: disable=too-many-nested-blocks - if isinstance(args[0], ET.Element): - existed_attr_keys = [] - model_meta = getattr(self, "_xml", {}) - - for rf in self._attr_to_rest_field.values(): - prop_meta = getattr(rf, "_xml", {}) - xml_name = prop_meta.get("name", rf._rest_name) - xml_ns = prop_meta.get("ns", model_meta.get("ns", None)) - if xml_ns: - xml_name = "{" + xml_ns + "}" + xml_name - - # attribute - if prop_meta.get("attribute", False) and args[0].get(xml_name) is not None: - existed_attr_keys.append(xml_name) - dict_to_pass[rf._rest_name] = _deserialize(rf._type, args[0].get(xml_name)) - continue - - # unwrapped element is array - if prop_meta.get("unwrapped", False): - # unwrapped array could either use prop items meta/prop meta - if prop_meta.get("itemsName"): - xml_name = prop_meta.get("itemsName") - xml_ns = prop_meta.get("itemNs") - if xml_ns: - xml_name = "{" + xml_ns + "}" + xml_name - items = args[0].findall(xml_name) # pyright: ignore - if len(items) > 0: - existed_attr_keys.append(xml_name) - dict_to_pass[rf._rest_name] = _deserialize(rf._type, items) - continue - - # text element is primitive type - if prop_meta.get("text", False): - if args[0].text is not None: - dict_to_pass[rf._rest_name] = _deserialize(rf._type, args[0].text) - continue - - # wrapped element could be normal property or array, it should only have one element - item = args[0].find(xml_name) - if item is not None: - existed_attr_keys.append(xml_name) - dict_to_pass[rf._rest_name] = _deserialize(rf._type, item) - - # rest thing is additional properties - for e in args[0]: - if e.tag not in existed_attr_keys: - dict_to_pass[e.tag] = _convert_element(e) - else: - 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: - 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__") - for k, v in mro_class.__annotations__.items() - } - 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__"): - base.__mapping__[discriminator or cls.__name__] = cls # type: ignore - - @classmethod - def _get_discriminator(cls, exist_discriminators) -> typing.Optional["_RestField"]: - for v in cls.__dict__.values(): - if isinstance(v, _RestField) and v._is_discriminator and v._rest_name not in exist_discriminators: - return v - return None - - @classmethod - def _deserialize(cls, data, exist_discriminators): - if not hasattr(cls, "__mapping__"): - return cls(data) - discriminator = cls._get_discriminator(exist_discriminators) - if discriminator is None: - return cls(data) - exist_discriminators.append(discriminator._rest_name) - if isinstance(data, ET.Element): - model_meta = getattr(cls, "_xml", {}) - prop_meta = getattr(discriminator, "_xml", {}) - xml_name = prop_meta.get("name", discriminator._rest_name) - xml_ns = prop_meta.get("ns", model_meta.get("ns", None)) - if xml_ns: - xml_name = "{" + xml_ns + "}" + xml_name - - if data.get(xml_name) is not None: - discriminator_value = data.get(xml_name) - else: - discriminator_value = data.find(xml_name).text # pyright: ignore - else: - discriminator_value = data.get(discriminator._rest_name) - mapped_cls = cls.__mapping__.get(discriminator_value, cls) # pyright: ignore - return mapped_cls._deserialize(data, exist_discriminators) - - def as_dict(self, *, exclude_readonly: bool = False) -> typing.Dict[str, typing.Any]: - """Return a dict that can be turned into json 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 - if isinstance(obj, ET.Element): - obj = {child.tag: child for child in 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 - if isinstance(obj, ET.Element): - obj = list(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=too-many-return-statements, too-many-branches - annotation: typing.Any, - module: typing.Optional[str], - rf: typing.Optional["_RestField"] = None, -) -> typing.Optional[typing.Callable[[typing.Any], typing.Any]]: - if not annotation: - 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) # type: ignore - - 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, -): # pylint: disable=too-many-return-statements - try: - if value is None or isinstance(value, _Null): - return None - if isinstance(value, ET.Element): - if deserializer is str: - return value.text or "" - if deserializer is int: - return int(value.text) if value.text else None - if deserializer is float: - return float(value.text) if value.text else None - if deserializer is bool: - return value.text == "true" if value.text else None - if deserializer is None: - return value - if deserializer in [int, float, bool]: - return deserializer(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) - - -def _failsafe_deserialize( - deserializer: typing.Any, - value: typing.Any, - module: typing.Optional[str] = None, - rf: typing.Optional["_RestField"] = None, - format: typing.Optional[str] = None, -) -> typing.Any: - try: - return _deserialize(deserializer, value, module, rf, format) - except DeserializationError: - _LOGGER.warning( - "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True - ) - return None - - -def _failsafe_deserialize_xml( - deserializer: typing.Any, - value: typing.Any, -) -> typing.Any: - try: - return _deserialize_xml(deserializer, value) - except DeserializationError: - _LOGGER.warning( - "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True - ) - return None - - -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, - xml: typing.Optional[typing.Dict[str, typing.Any]] = None, - ): - 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 - self._xml = xml if xml is not None else {} - - @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, - xml: typing.Optional[typing.Dict[str, typing.Any]] = None, -) -> typing.Any: - return _RestField( - name=name, - type=type, - visibility=visibility, - default=default, - format=format, - is_multipart_file_input=is_multipart_file_input, - xml=xml, - ) - - -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, - xml: typing.Optional[typing.Dict[str, typing.Any]] = None, -) -> typing.Any: - return _RestField(name=name, type=type, is_discriminator=True, visibility=visibility, xml=xml) - - -def serialize_xml(model: Model, exclude_readonly: bool = False) -> str: - """Serialize a model to XML. - - :param Model model: The model to serialize. - :param bool exclude_readonly: Whether to exclude readonly properties. - :returns: The XML representation of the model. - :rtype: str - """ - return ET.tostring(_get_element(model, exclude_readonly), encoding="unicode") # type: ignore - - -def _get_element( - o: typing.Any, - exclude_readonly: bool = False, - parent_meta: typing.Optional[typing.Dict[str, typing.Any]] = None, - wrapped_element: typing.Optional[ET.Element] = None, -) -> typing.Union[ET.Element, typing.List[ET.Element]]: - if _is_model(o): - model_meta = getattr(o, "_xml", {}) - - # if prop is a model, then use the prop element directly, else generate a wrapper of model - if wrapped_element is None: - wrapped_element = _create_xml_element( - model_meta.get("name", o.__class__.__name__), - model_meta.get("prefix"), - model_meta.get("ns"), - ) - - readonly_props = [] - if exclude_readonly: - readonly_props = [p._rest_name for p in o._attr_to_rest_field.values() if _is_readonly(p)] - - for k, v in o.items(): - # do not serialize readonly properties - if exclude_readonly and k in readonly_props: - continue - - prop_rest_field = _get_rest_field(o._attr_to_rest_field, k) - if prop_rest_field: - prop_meta = getattr(prop_rest_field, "_xml").copy() - # use the wire name as xml name if no specific name is set - if prop_meta.get("name") is None: - prop_meta["name"] = k - else: - # additional properties will not have rest field, use the wire name as xml name - prop_meta = {"name": k} - - # if no ns for prop, use model's - if prop_meta.get("ns") is None and model_meta.get("ns"): - prop_meta["ns"] = model_meta.get("ns") - prop_meta["prefix"] = model_meta.get("prefix") - - if prop_meta.get("unwrapped", False): - # unwrapped could only set on array - wrapped_element.extend(_get_element(v, exclude_readonly, prop_meta)) - elif prop_meta.get("text", False): - # text could only set on primitive type - wrapped_element.text = _get_primitive_type_value(v) - elif prop_meta.get("attribute", False): - xml_name = prop_meta.get("name", k) - if prop_meta.get("ns"): - ET.register_namespace(prop_meta.get("prefix"), prop_meta.get("ns")) # pyright: ignore - xml_name = "{" + prop_meta.get("ns") + "}" + xml_name # pyright: ignore - # attribute should be primitive type - wrapped_element.set(xml_name, _get_primitive_type_value(v)) - else: - # other wrapped prop element - wrapped_element.append(_get_wrapped_element(v, exclude_readonly, prop_meta)) - return wrapped_element - if isinstance(o, list): - return [_get_element(x, exclude_readonly, parent_meta) for x in o] # type: ignore - if isinstance(o, dict): - result = [] - for k, v in o.items(): - result.append( - _get_wrapped_element( - v, - exclude_readonly, - { - "name": k, - "ns": parent_meta.get("ns") if parent_meta else None, - "prefix": parent_meta.get("prefix") if parent_meta else None, - }, - ) - ) - return result - - # primitive case need to create element based on parent_meta - if parent_meta: - return _get_wrapped_element( - o, - exclude_readonly, - { - "name": parent_meta.get("itemsName", parent_meta.get("name")), - "prefix": parent_meta.get("itemsPrefix", parent_meta.get("prefix")), - "ns": parent_meta.get("itemsNs", parent_meta.get("ns")), - }, - ) - - raise ValueError("Could not serialize value into xml: " + o) - - -def _get_wrapped_element( - v: typing.Any, - exclude_readonly: bool, - meta: typing.Optional[typing.Dict[str, typing.Any]], -) -> ET.Element: - wrapped_element = _create_xml_element( - meta.get("name") if meta else None, meta.get("prefix") if meta else None, meta.get("ns") if meta else None - ) - if isinstance(v, (dict, list)): - wrapped_element.extend(_get_element(v, exclude_readonly, meta)) - elif _is_model(v): - _get_element(v, exclude_readonly, meta, wrapped_element) - else: - wrapped_element.text = _get_primitive_type_value(v) - return wrapped_element - - -def _get_primitive_type_value(v) -> str: - if v is True: - return "true" - if v is False: - return "false" - if isinstance(v, _Null): - return "" - return str(v) - - -def _create_xml_element(tag, prefix=None, ns=None): - if prefix and ns: - ET.register_namespace(prefix, ns) - if ns: - return ET.Element("{" + ns + "}" + tag) - return ET.Element(tag) - - -def _deserialize_xml( - deserializer: typing.Any, - value: str, -) -> typing.Any: - element = ET.fromstring(value) # nosec - return _deserialize(deserializer, element) - - -def _convert_element(e: ET.Element): - # dict case - if len(e.attrib) > 0 or len({child.tag for child in e}) > 1: - dict_result: typing.Dict[str, typing.Any] = {} - for child in e: - if dict_result.get(child.tag) is not None: - if isinstance(dict_result[child.tag], list): - dict_result[child.tag].append(_convert_element(child)) - else: - dict_result[child.tag] = [dict_result[child.tag], _convert_element(child)] - else: - dict_result[child.tag] = _convert_element(child) - dict_result.update(e.attrib) - return dict_result - # array case - if len(e) > 0: - array_result: typing.List[typing.Any] = [] - for child in e: - array_result.append(_convert_element(child)) - return array_result - # primitive case - return e.text diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_operations/__init__.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_operations/__init__.py deleted file mode 100644 index 4a8ff7f9c39..00000000000 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_operations/__init__.py +++ /dev/null @@ -1,19 +0,0 @@ -# coding=utf-8 -# pylint: disable=wrong-import-position - -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from ._patch import * # pylint: disable=unused-wildcard-import - -from ._operations import ResiliencyServiceDrivenClientOperationsMixin # type: ignore - -from ._patch import __all__ as _patch_all -from ._patch import * -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "ResiliencyServiceDrivenClientOperationsMixin", -] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore -_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_operations/_operations.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_operations/_operations.py deleted file mode 100644 index 0e5b9651387..00000000000 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_operations/_operations.py +++ /dev/null @@ -1,318 +0,0 @@ -# coding=utf-8 -import sys -from typing import Any, Callable, Dict, Optional, 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 .._validation import api_version_validation -from .._vendor import ResiliencyServiceDrivenClientMixinABC - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_resiliency_service_driven_add_operation_request( # pylint: disable=name-too-long - **kwargs: Any, -) -> HttpRequest: - # Construct URL - _url = "/add-operation" - - return HttpRequest(method="DELETE", url=_url, **kwargs) - - -def build_resiliency_service_driven_from_none_request( # pylint: disable=name-too-long - *, new_parameter: Optional[str] = None, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - # Construct URL - _url = "/add-optional-param/from-none" - - # Construct parameters - if new_parameter is not None: - _params["new-parameter"] = _SERIALIZER.query("new_parameter", new_parameter, "str") - - return HttpRequest(method="HEAD", url=_url, params=_params, **kwargs) - - -def build_resiliency_service_driven_from_one_required_request( # pylint: disable=name-too-long - *, parameter: str, new_parameter: Optional[str] = None, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - # Construct URL - _url = "/add-optional-param/from-one-required" - - # Construct parameters - _params["parameter"] = _SERIALIZER.query("parameter", parameter, "str") - if new_parameter is not None: - _params["new-parameter"] = _SERIALIZER.query("new_parameter", new_parameter, "str") - - return HttpRequest(method="GET", url=_url, params=_params, **kwargs) - - -def build_resiliency_service_driven_from_one_optional_request( # pylint: disable=name-too-long - *, parameter: Optional[str] = None, new_parameter: Optional[str] = None, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - # Construct URL - _url = "/add-optional-param/from-one-optional" - - # Construct parameters - if parameter is not None: - _params["parameter"] = _SERIALIZER.query("parameter", parameter, "str") - if new_parameter is not None: - _params["new-parameter"] = _SERIALIZER.query("new_parameter", new_parameter, "str") - - return HttpRequest(method="GET", url=_url, params=_params, **kwargs) - - -class ResiliencyServiceDrivenClientOperationsMixin( # pylint: disable=name-too-long - ResiliencyServiceDrivenClientMixinABC -): - - @distributed_trace - @api_version_validation( - method_added_on="v2", - ) - def add_operation(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements - """Added operation. - - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_resiliency_service_driven_add_operation_request( - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - "serviceDeploymentVersion": self._serialize.url( - "self._config.service_deployment_version", self._config.service_deployment_version, "str" - ), - "apiVersion": self._serialize.url("self._config.api_version", self._config.api_version, "str"), - } - _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 - @api_version_validation( - params_added_on={"v2": ["new_parameter"]}, - ) - def from_none(self, *, new_parameter: Optional[str] = None, **kwargs: Any) -> bool: - """Test that grew up from accepting no parameters to an optional input parameter. - - :keyword new_parameter: I'm a new input optional parameter. Default value is None. - :paramtype new_parameter: str - :return: bool - :rtype: bool - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_resiliency_service_driven_from_none_request( - new_parameter=new_parameter, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - "serviceDeploymentVersion": self._serialize.url( - "self._config.service_deployment_version", self._config.service_deployment_version, "str" - ), - "apiVersion": self._serialize.url("self._config.api_version", self._config.api_version, "str"), - } - _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 - @api_version_validation( - params_added_on={"v2": ["new_parameter"]}, - ) - def from_one_required( # pylint: disable=inconsistent-return-statements - self, *, parameter: str, new_parameter: Optional[str] = None, **kwargs: Any - ) -> None: - """Operation that grew up from accepting one required parameter to accepting a required parameter - and an optional parameter. - - :keyword parameter: I am a required parameter. Required. - :paramtype parameter: str - :keyword new_parameter: I'm a new input optional parameter. Default value is None. - :paramtype new_parameter: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_resiliency_service_driven_from_one_required_request( - parameter=parameter, - new_parameter=new_parameter, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - "serviceDeploymentVersion": self._serialize.url( - "self._config.service_deployment_version", self._config.service_deployment_version, "str" - ), - "apiVersion": self._serialize.url("self._config.api_version", self._config.api_version, "str"), - } - _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 - @api_version_validation( - params_added_on={"v2": ["new_parameter"]}, - ) - def from_one_optional( # pylint: disable=inconsistent-return-statements - self, *, parameter: Optional[str] = None, new_parameter: Optional[str] = None, **kwargs: Any - ) -> None: - """Tests that we can grow up an operation from accepting one optional parameter to accepting two - optional parameters. - - :keyword parameter: I am an optional parameter. Default value is None. - :paramtype parameter: str - :keyword new_parameter: I'm a new input optional parameter. Default value is None. - :paramtype new_parameter: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_resiliency_service_driven_from_one_optional_request( - parameter=parameter, - new_parameter=new_parameter, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - "serviceDeploymentVersion": self._serialize.url( - "self._config.service_deployment_version", self._config.service_deployment_version, "str" - ), - "apiVersion": self._serialize.url("self._config.api_version", self._config.api_version, "str"), - } - _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/resiliency-srv-driven2/resiliency/srv/driven2/_operations/_patch.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_operations/_patch.py deleted file mode 100644 index 8bcb627aa47..00000000000 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_operations/_patch.py +++ /dev/null @@ -1,21 +0,0 @@ -# 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. -# -------------------------------------------------------------------------- -"""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/resiliency-srv-driven2/resiliency/srv/driven2/_patch.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_patch.py deleted file mode 100644 index 8bcb627aa47..00000000000 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_patch.py +++ /dev/null @@ -1,21 +0,0 @@ -# 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. -# -------------------------------------------------------------------------- -"""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/resiliency-srv-driven2/resiliency/srv/driven2/_serialization.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_serialization.py deleted file mode 100644 index f71dbc0833e..00000000000 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_serialization.py +++ /dev/null @@ -1,2026 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression,too-many-lines -# coding=utf-8 - -# 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, - MutableMapping, - 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 typing_extensions import Self - -from azure.core.exceptions import DeserializationError, SerializationError -from azure.core.serialization import NULL as CoreNull - -_BOM = codecs.BOM_UTF8.decode(encoding="utf-8") - -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 - -TZ_UTC = datetime.timezone.utc - -_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, data: Any, content_type: Optional[str] = None) -> Self: - """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: Self - """ - deserializer = Deserializer(cls._infer_class_models()) - return deserializer(cls.__name__, data, content_type=content_type) # type: ignore - - @classmethod - def from_dict( - cls, - data: Any, - key_extractors: Optional[Callable[[str, Dict[str, Any], Any], Any]] = None, - content_type: Optional[str] = None, - ) -> Self: - """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: Self - """ - 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. - - :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.get(rest_api_response_key, None) or response.get(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: # 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) -> 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( - 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: - """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) -> 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() # pylint: disable=protected-access # type: ignore - if v.get("readonly") - ] - const = [ - k - for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore - if v.get("constant") - ] - 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 # type: ignore - 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=datetime.timezone(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/resiliency-srv-driven2/resiliency/srv/driven2/_validation.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_validation.py deleted file mode 100644 index 964148cf00e..00000000000 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_validation.py +++ /dev/null @@ -1,44 +0,0 @@ -import functools - - -def api_version_validation(**kwargs): - params_added_on = kwargs.pop("params_added_on", {}) - method_added_on = kwargs.pop("method_added_on", "") - - def decorator(func): - @functools.wraps(func) - def wrapper(*args, **kwargs): - try: - # this assumes the client has an _api_version attribute - client = args[0] - client_api_version = client._config.api_version # pylint: disable=protected-access - except AttributeError: - return func(*args, **kwargs) - - if method_added_on > client_api_version: - raise ValueError( - f"'{func.__name__}' is not available in API version " - f"{client_api_version}. Pass service API version {method_added_on} or newer to your client." - ) - - unsupported = { - parameter: api_version - for api_version, parameters in params_added_on.items() - for parameter in parameters - if parameter in kwargs and api_version > client_api_version - } - if unsupported: - raise ValueError( - "".join( - [ - f"'{param}' is not available in API version {client_api_version}. " - f"Use service API version {version} or newer.\n" - for param, version in unsupported.items() - ] - ) - ) - return func(*args, **kwargs) - - return wrapper - - return decorator diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_vendor.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_vendor.py deleted file mode 100644 index a1f1bf8898a..00000000000 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_vendor.py +++ /dev/null @@ -1,18 +0,0 @@ -from abc import ABC -from typing import TYPE_CHECKING - -from ._configuration import ResiliencyServiceDrivenClientConfiguration - -if TYPE_CHECKING: - from azure.core import PipelineClient - - from ._serialization import Deserializer, Serializer - - -class ResiliencyServiceDrivenClientMixinABC(ABC): - """DO NOT use this class. It is for internal typing use only.""" - - _client: "PipelineClient" - _config: ResiliencyServiceDrivenClientConfiguration - _serialize: "Serializer" - _deserialize: "Deserializer" diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_version.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_version.py deleted file mode 100644 index 9f6458b8cda..00000000000 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_version.py +++ /dev/null @@ -1,3 +0,0 @@ -# coding=utf-8 - -VERSION = "1.0.0b1" diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/aio/__init__.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/aio/__init__.py deleted file mode 100644 index 4f41aabeaa2..00000000000 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/aio/__init__.py +++ /dev/null @@ -1,23 +0,0 @@ -# coding=utf-8 -# pylint: disable=wrong-import-position - -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from ._patch import * # pylint: disable=unused-wildcard-import - -from ._client import ResiliencyServiceDrivenClient # type: ignore - -try: - from ._patch import __all__ as _patch_all - from ._patch import * -except ImportError: - _patch_all = [] -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "ResiliencyServiceDrivenClient", -] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore - -_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/aio/_client.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/aio/_client.py deleted file mode 100644 index 1f90d8deab5..00000000000 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/aio/_client.py +++ /dev/null @@ -1,122 +0,0 @@ -# coding=utf-8 - -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 ResiliencyServiceDrivenClientConfiguration -from ._operations import ResiliencyServiceDrivenClientOperationsMixin - - -class ResiliencyServiceDrivenClient(ResiliencyServiceDrivenClientOperationsMixin): - """Test that we can grow up a service spec and service deployment into a multi-versioned service - with full client support. - - There are three concepts that should be clarified: - - 1. Client spec version: refers to the spec that the client is generated from. 'v1' is a client - generated from old.tsp and 'v2' is a client generated from main.tsp. - 2. Service deployment version: refers to a deployment version of the service. 'v1' represents - the initial deployment of the service with a single api version. 'v2' represents the new - deployment of a service with multiple api versions - 3. Api version: The initial deployment of the service only supports api version 'v1'. The new - deployment of the service supports api versions 'v1' and 'v2'. - - We test the following configurations from this service spec: - - * A client generated from the second service spec can call the second deployment of a service - with api version v1 - * A client generated from the second service spec can call the second deployment of a service - with api version v2. - - :param endpoint: Need to be set as '`http://localhost:3000 `_' in - client. Required. - :type endpoint: str - :param service_deployment_version: Pass in either 'v1' or 'v2'. This represents a version of - the service deployment in history. 'v1' is for the deployment when the service had only one api - version. 'v2' is for the deployment when the service had api-versions 'v1' and 'v2'. Required. - :type service_deployment_version: str - :keyword api_version: Pass in either 'v1' or 'v2'. This represents the API version of a - service. Known values are "v2" and None. Default value is "v2". Note that overriding this - default value may result in unsupported behavior. - :paramtype api_version: str - """ - - def __init__( # pylint: disable=missing-client-constructor-parameter-credential - self, endpoint: str, service_deployment_version: str, **kwargs: Any - ) -> None: - _endpoint = ( - "{endpoint}/resiliency/service-driven/client:v2/service:{serviceDeploymentVersion}/api-version:{apiVersion}" - ) - self._config = ResiliencyServiceDrivenClientConfiguration( - endpoint=endpoint, service_deployment_version=service_deployment_version, **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 - - 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), - "serviceDeploymentVersion": self._serialize.url( - "self._config.service_deployment_version", self._config.service_deployment_version, "str" - ), - "apiVersion": self._serialize.url("self._config.api_version", self._config.api_version, "str"), - } - - 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/resiliency-srv-driven2/resiliency/srv/driven2/aio/_configuration.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/aio/_configuration.py deleted file mode 100644 index e17d5396869..00000000000 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/aio/_configuration.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding=utf-8 - -from typing import Any - -from azure.core.pipeline import policies - -from .._version import VERSION - - -class ResiliencyServiceDrivenClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long - """Configuration for ResiliencyServiceDrivenClient. - - Note that all parameters used to create this instance are saved as instance - attributes. - - :param endpoint: Need to be set as '`http://localhost:3000 `_' in - client. Required. - :type endpoint: str - :param service_deployment_version: Pass in either 'v1' or 'v2'. This represents a version of - the service deployment in history. 'v1' is for the deployment when the service had only one api - version. 'v2' is for the deployment when the service had api-versions 'v1' and 'v2'. Required. - :type service_deployment_version: str - :keyword api_version: Pass in either 'v1' or 'v2'. This represents the API version of a - service. Known values are "v2" and None. Default value is "v2". Note that overriding this - default value may result in unsupported behavior. - :paramtype api_version: str - """ - - def __init__(self, endpoint: str, service_deployment_version: str, **kwargs: Any) -> None: - api_version: str = kwargs.pop("api_version", "v2") - - if endpoint is None: - raise ValueError("Parameter 'endpoint' must not be None.") - if service_deployment_version is None: - raise ValueError("Parameter 'service_deployment_version' must not be None.") - - self.endpoint = endpoint - self.service_deployment_version = service_deployment_version - self.api_version = api_version - kwargs.setdefault("sdk_moniker", "resiliency-srv-driven2/{}".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/resiliency-srv-driven2/resiliency/srv/driven2/aio/_operations/__init__.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/aio/_operations/__init__.py deleted file mode 100644 index 4a8ff7f9c39..00000000000 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/aio/_operations/__init__.py +++ /dev/null @@ -1,19 +0,0 @@ -# coding=utf-8 -# pylint: disable=wrong-import-position - -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from ._patch import * # pylint: disable=unused-wildcard-import - -from ._operations import ResiliencyServiceDrivenClientOperationsMixin # type: ignore - -from ._patch import __all__ as _patch_all -from ._patch import * -from ._patch import patch_sdk as _patch_sdk - -__all__ = [ - "ResiliencyServiceDrivenClientOperationsMixin", -] -__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore -_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/aio/_operations/_operations.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/aio/_operations/_operations.py deleted file mode 100644 index 97493602f33..00000000000 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/aio/_operations/_operations.py +++ /dev/null @@ -1,261 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# coding=utf-8 -import sys -from typing import Any, Callable, Dict, Optional, 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_resiliency_service_driven_add_operation_request, - build_resiliency_service_driven_from_none_request, - build_resiliency_service_driven_from_one_optional_request, - build_resiliency_service_driven_from_one_required_request, -) -from ..._validation import api_version_validation -from .._vendor import ResiliencyServiceDrivenClientMixinABC - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class ResiliencyServiceDrivenClientOperationsMixin( # pylint: disable=name-too-long - ResiliencyServiceDrivenClientMixinABC -): - - @distributed_trace_async - @api_version_validation( - method_added_on="v2", - ) - async def add_operation(self, **kwargs: Any) -> None: - """Added operation. - - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_resiliency_service_driven_add_operation_request( - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - "serviceDeploymentVersion": self._serialize.url( - "self._config.service_deployment_version", self._config.service_deployment_version, "str" - ), - "apiVersion": self._serialize.url("self._config.api_version", self._config.api_version, "str"), - } - _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 - - @distributed_trace_async - @api_version_validation( - params_added_on={"v2": ["new_parameter"]}, - ) - async def from_none(self, *, new_parameter: Optional[str] = None, **kwargs: Any) -> bool: - """Test that grew up from accepting no parameters to an optional input parameter. - - :keyword new_parameter: I'm a new input optional parameter. Default value is None. - :paramtype new_parameter: str - :return: bool - :rtype: bool - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_resiliency_service_driven_from_none_request( - new_parameter=new_parameter, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - "serviceDeploymentVersion": self._serialize.url( - "self._config.service_deployment_version", self._config.service_deployment_version, "str" - ), - "apiVersion": self._serialize.url("self._config.api_version", self._config.api_version, "str"), - } - _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 - @api_version_validation( - params_added_on={"v2": ["new_parameter"]}, - ) - async def from_one_required(self, *, parameter: str, new_parameter: Optional[str] = None, **kwargs: Any) -> None: - """Operation that grew up from accepting one required parameter to accepting a required parameter - and an optional parameter. - - :keyword parameter: I am a required parameter. Required. - :paramtype parameter: str - :keyword new_parameter: I'm a new input optional parameter. Default value is None. - :paramtype new_parameter: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_resiliency_service_driven_from_one_required_request( - parameter=parameter, - new_parameter=new_parameter, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - "serviceDeploymentVersion": self._serialize.url( - "self._config.service_deployment_version", self._config.service_deployment_version, "str" - ), - "apiVersion": self._serialize.url("self._config.api_version", self._config.api_version, "str"), - } - _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 - - @distributed_trace_async - @api_version_validation( - params_added_on={"v2": ["new_parameter"]}, - ) - async def from_one_optional( - self, *, parameter: Optional[str] = None, new_parameter: Optional[str] = None, **kwargs: Any - ) -> None: - """Tests that we can grow up an operation from accepting one optional parameter to accepting two - optional parameters. - - :keyword parameter: I am an optional parameter. Default value is None. - :paramtype parameter: str - :keyword new_parameter: I'm a new input optional parameter. Default value is None. - :paramtype new_parameter: str - :return: None - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = kwargs.pop("params", {}) or {} - - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_resiliency_service_driven_from_one_optional_request( - parameter=parameter, - new_parameter=new_parameter, - headers=_headers, - params=_params, - ) - path_format_arguments = { - "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), - "serviceDeploymentVersion": self._serialize.url( - "self._config.service_deployment_version", self._config.service_deployment_version, "str" - ), - "apiVersion": self._serialize.url("self._config.api_version", self._config.api_version, "str"), - } - _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/resiliency-srv-driven2/resiliency/srv/driven2/aio/_operations/_patch.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/aio/_operations/_patch.py deleted file mode 100644 index 8bcb627aa47..00000000000 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/aio/_operations/_patch.py +++ /dev/null @@ -1,21 +0,0 @@ -# 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. -# -------------------------------------------------------------------------- -"""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/resiliency-srv-driven2/resiliency/srv/driven2/aio/_patch.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/aio/_patch.py deleted file mode 100644 index 8bcb627aa47..00000000000 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/aio/_patch.py +++ /dev/null @@ -1,21 +0,0 @@ -# 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. -# -------------------------------------------------------------------------- -"""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/resiliency-srv-driven2/resiliency/srv/driven2/aio/_vendor.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/aio/_vendor.py deleted file mode 100644 index a683c047d98..00000000000 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/aio/_vendor.py +++ /dev/null @@ -1,18 +0,0 @@ -from abc import ABC -from typing import TYPE_CHECKING - -from ._configuration import ResiliencyServiceDrivenClientConfiguration - -if TYPE_CHECKING: - from azure.core import AsyncPipelineClient - - from .._serialization import Deserializer, Serializer - - -class ResiliencyServiceDrivenClientMixinABC(ABC): - """DO NOT use this class. It is for internal typing use only.""" - - _client: "AsyncPipelineClient" - _config: ResiliencyServiceDrivenClientConfiguration - _serialize: "Serializer" - _deserialize: "Deserializer" diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/py.typed b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/py.typed deleted file mode 100644 index e5aff4f83af..00000000000 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/py.typed +++ /dev/null @@ -1 +0,0 @@ -# Marker file for PEP 561. \ No newline at end of file diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/setup.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/setup.py deleted file mode 100644 index fa5b438752d..00000000000 --- a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/setup.py +++ /dev/null @@ -1,65 +0,0 @@ -# coding=utf-8 - - -import os -import re -from setuptools import setup, find_packages - - -PACKAGE_NAME = "resiliency-srv-driven2" -PACKAGE_PPRINT_NAME = "ResiliencySrvDriven2" - -# 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 Corporation {} 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", - # Exclude packages that will be covered by PEP420 or nspkg - "resiliency", - "resiliency.srv", - ] - ), - include_package_data=True, - package_data={ - "resiliency.srv.driven2": ["py.typed"], - }, - install_requires=[ - "isodate>=0.6.1", - "azure-core>=1.30.0", - "typing-extensions>=4.6.0", - ], - python_requires=">=3.8", -) From c005d7dd952c1c02557ee7fb50c1c05c60903409 Mon Sep 17 00:00:00 2001 From: tadelesh Date: Tue, 1 Apr 2025 22:05:36 +0800 Subject: [PATCH 09/19] format --- packages/typespec-python/src/lib.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/typespec-python/src/lib.ts b/packages/typespec-python/src/lib.ts index e28a0aa76d5..43352489d33 100644 --- a/packages/typespec-python/src/lib.ts +++ b/packages/typespec-python/src/lib.ts @@ -4,7 +4,7 @@ import { PythonEmitterOptions, PythonEmitterOptionsSchema } from "@typespec/http export interface PythonAzureEmitterOptions extends PythonEmitterOptions { "examples-dir"?: string; - namespace?: string; + "namespace"?: string; "flavor"?: "azure"; "models-mode"?: string; From 81364da6ac0674b599036094c5e965acdc8f5ee5 Mon Sep 17 00:00:00 2001 From: Yuchao Yan Date: Wed, 2 Apr 2025 18:22:42 +0800 Subject: [PATCH 10/19] update dependency --- packages/typespec-python/package.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/typespec-python/package.json b/packages/typespec-python/package.json index cbe697af71b..72a7dbb725b 100644 --- a/packages/typespec-python/package.json +++ b/packages/typespec-python/package.json @@ -82,6 +82,8 @@ "@azure-tools/typespec-client-generator-core": "~0.54.0-dev.19", "@azure-tools/azure-http-specs": "0.1.0-alpha.13-dev.1", "@typespec/http-specs": "0.1.0-alpha.17-dev.1", + "@typespec/spec-api": "0.1.0-alpha.4-dev.0", + "@typespec/spector": "0.1.0-alpha.11-dev.2", "@types/js-yaml": "~4.0.5", "@types/node": "~22.5.4", "@types/yargs": "~17.0.33", @@ -95,4 +97,4 @@ "chalk": "5.3.0", "@types/fs-extra": "11.0.4" } -} \ No newline at end of file +} From bb6797f9425c2b19ee764a6283b024455835d05d Mon Sep 17 00:00:00 2001 From: AutoPrFromHttpClientPython Date: Wed, 2 Apr 2025 10:27:06 +0000 Subject: [PATCH 11/19] Update dependencies (2025-04-02 10:27:06) --- packages/autorest.python/package.json | 2 +- packages/typespec-python/package.json | 64 +- pnpm-lock.yaml | 1215 ++++++------------------- 3 files changed, 336 insertions(+), 945 deletions(-) diff --git a/packages/autorest.python/package.json b/packages/autorest.python/package.json index a35206cc380..d3e8dadc336 100644 --- a/packages/autorest.python/package.json +++ b/packages/autorest.python/package.json @@ -29,7 +29,7 @@ }, "homepage": "https://github.com/Azure/autorest.python/blob/main/README.md", "dependencies": { - "@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcwOTg1Ny9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.2.tgz", + "@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcxNDA2NS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.2.tgz", "@autorest/system-requirements": "~1.0.2", "fs-extra": "~11.2.0", "tsx": "~4.19.1" diff --git a/packages/typespec-python/package.json b/packages/typespec-python/package.json index 72a7dbb725b..c62ce8e9b91 100644 --- a/packages/typespec-python/package.json +++ b/packages/typespec-python/package.json @@ -45,56 +45,56 @@ "generator/**" ], "peerDependencies": { - "@typespec/compiler": ">=0.68.0-dev.11 <1.0.0", - "@typespec/http": ">=0.68.0-dev.8 <1.0.0", - "@typespec/rest": ">=0.68.0-dev.3 <1.0.0", - "@typespec/versioning": ">=0.68.0-dev.2 <1.0.0", - "@typespec/openapi": ">=0.68.0-dev.3 <1.0.0", - "@typespec/events": ">=0.68.0-dev.2 <1.0.0", - "@typespec/sse": ">=0.68.0-dev.2 <1.0.0", - "@typespec/streams": ">=0.68.0-dev.2 <1.0.0", - "@azure-tools/typespec-azure-core": ">=0.54.0-dev.5 <1.0.0", - "@azure-tools/typespec-azure-resource-manager": ">=0.54.0-dev.3 <1.0.0", - "@azure-tools/typespec-autorest": ">=0.54.0-dev.5 <1.0.0", - "@azure-tools/typespec-azure-rulesets": ">=0.54.0-dev.2 <3.0.0", - "@azure-tools/typespec-client-generator-core": ">=0.54.0-dev.19 <1.0.0" + "@typespec/compiler": "0.68.0-dev.13", + "@typespec/http": "0.68.0-dev.9", + "@typespec/rest": "0.68.0-dev.4", + "@typespec/versioning": "0.68.0-dev.3", + "@typespec/openapi": "0.68.0-dev.3", + "@typespec/events": ">=0.68.0-dev.3 <1.0.0", + "@typespec/sse": ">=0.68.0-dev.3 <1.0.0", + "@typespec/streams": ">=0.68.0-dev.3 <1.0.0", + "@azure-tools/typespec-azure-core": "0.54.0-dev.5", + "@azure-tools/typespec-azure-resource-manager": "0.54.0-dev.4", + "@azure-tools/typespec-autorest": "0.54.0-dev.5", + "@azure-tools/typespec-azure-rulesets": "0.54.0-dev.2", + "@azure-tools/typespec-client-generator-core": "0.54.0-dev.22" }, "dependencies": { "js-yaml": "~4.1.0", "semver": "~7.6.2", "tsx": "~4.19.1", - "@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcwOTg1Ny9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.2.tgz", + "@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcxNDA2NS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.2.tgz", "fs-extra": "~11.2.0" }, "devDependencies": { - "@typespec/compiler": "~0.68.0-dev.11", - "@typespec/http": "~0.68.0-dev.8", - "@typespec/rest": "~0.68.0-dev.3", - "@typespec/versioning": "~0.68.0-dev.2", - "@typespec/openapi": "~0.68.0-dev.3", - "@typespec/events": "~0.68.0-dev.2", - "@typespec/sse": "~0.68.0-dev.2", - "@typespec/streams": "~0.68.0-dev.2", - "@azure-tools/typespec-azure-resource-manager": "~0.54.0-dev.3", - "@azure-tools/typespec-azure-core": "~0.54.0-dev.5", - "@azure-tools/typespec-azure-rulesets": "~0.54.0-dev.2", - "@azure-tools/typespec-autorest": "~0.54.0-dev.5", - "@azure-tools/typespec-client-generator-core": "~0.54.0-dev.19", - "@azure-tools/azure-http-specs": "0.1.0-alpha.13-dev.1", - "@typespec/http-specs": "0.1.0-alpha.17-dev.1", + "@typespec/compiler": "0.68.0-dev.13", + "@typespec/http": "0.68.0-dev.9", + "@typespec/rest": "0.68.0-dev.4", + "@typespec/versioning": "0.68.0-dev.3", + "@typespec/openapi": "0.68.0-dev.3", + "@typespec/events": "~0.68.0-dev.3", + "@typespec/sse": "~0.68.0-dev.3", + "@typespec/streams": "~0.68.0-dev.3", + "@azure-tools/typespec-azure-resource-manager": "0.54.0-dev.4", + "@azure-tools/typespec-azure-core": "0.54.0-dev.5", + "@azure-tools/typespec-azure-rulesets": "0.54.0-dev.2", + "@azure-tools/typespec-autorest": "0.54.0-dev.5", + "@azure-tools/typespec-client-generator-core": "0.54.0-dev.22", + "@azure-tools/azure-http-specs": "0.1.0-alpha.13-dev.2", + "@typespec/http-specs": "0.1.0-alpha.17-dev.2", "@typespec/spec-api": "0.1.0-alpha.4-dev.0", "@typespec/spector": "0.1.0-alpha.11-dev.2", "@types/js-yaml": "~4.0.5", - "@types/node": "~22.5.4", + "@types/node": "~22.13.14", "@types/yargs": "~17.0.33", "@types/semver": "7.5.8", "c8": "^10.1.3", "vitest": "^3.0.5", "rimraf": "~6.0.1", - "typescript": "~5.7.3", + "typescript": "~5.8.2", "typescript-eslint": "^8.21.0", "yargs": "~17.7.2", "chalk": "5.3.0", "@types/fs-extra": "11.0.4" } -} +} \ No newline at end of file diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8ac437669df..27f92232674 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -57,8 +57,8 @@ importers: specifier: ~1.0.2 version: 1.0.2 '@typespec/http-client-python': - specifier: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcwOTg1Ny9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.2.tgz - version: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcwOTg1Ny9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.2.tgz(vc45nnffght74sl4sibvll3pxy) + specifier: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcxNDA2NS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.2.tgz + version: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcxNDA2NS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.2.tgz(7lctz6vgqeif7iqlya3bzwoexa) fs-extra: specifier: ~11.2.0 version: 11.2.0 @@ -79,8 +79,8 @@ importers: packages/typespec-python: dependencies: '@typespec/http-client-python': - specifier: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcwOTg1Ny9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.2.tgz - version: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcwOTg1Ny9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.2.tgz(vqafh2xgemu2dyfvlgvmut4cti) + specifier: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcxNDA2NS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.2.tgz + version: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcxNDA2NS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.2.tgz(7lctz6vgqeif7iqlya3bzwoexa) fs-extra: specifier: ~11.2.0 version: 11.2.0 @@ -95,23 +95,23 @@ importers: version: 4.19.3 devDependencies: '@azure-tools/azure-http-specs': - specifier: 0.1.0-alpha.13-dev.1 - version: 0.1.0-alpha.13-dev.1(dkz3jopup3kcww2tc3n27h5adi) + specifier: 0.1.0-alpha.13-dev.2 + version: 0.1.0-alpha.13-dev.2(2qclodw5tqlmu4xopqkjoaoqw4) '@azure-tools/typespec-autorest': - specifier: ~0.54.0-dev.5 - version: 0.54.0-dev.5(terlvcbdqtyv3m5pmsko2l6fny) + specifier: 0.54.0-dev.5 + version: 0.54.0-dev.5(slqx2jlvr2rb5u5z3itjv7na4u) '@azure-tools/typespec-azure-core': - specifier: ~0.54.0-dev.5 - version: 0.54.0-dev.5(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))(@typespec/rest@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))) + specifier: 0.54.0-dev.5 + version: 0.54.0-dev.5(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))))(@typespec/rest@0.68.0-dev.4(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))))) '@azure-tools/typespec-azure-resource-manager': - specifier: ~0.54.0-dev.3 - version: 0.54.0-dev.3(vvsjt7ss6dhpuzy2lahlecfu7a) + specifier: 0.54.0-dev.4 + version: 0.54.0-dev.4(qb3xdiittordn2dqsr2n6il7zy) '@azure-tools/typespec-azure-rulesets': - specifier: ~0.54.0-dev.2 - version: 0.54.0-dev.2(@azure-tools/typespec-azure-core@0.54.0-dev.5(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))(@typespec/rest@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))))(@azure-tools/typespec-azure-resource-manager@0.54.0-dev.3(vvsjt7ss6dhpuzy2lahlecfu7a))(@azure-tools/typespec-client-generator-core@0.54.0-dev.19(bi3uo6v4m3cwrf7tvdzqjmlfka))(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)) + specifier: 0.54.0-dev.2 + version: 0.54.0-dev.2(@azure-tools/typespec-azure-core@0.54.0-dev.5(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))))(@typespec/rest@0.68.0-dev.4(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))))))(@azure-tools/typespec-azure-resource-manager@0.54.0-dev.4(qb3xdiittordn2dqsr2n6il7zy))(@azure-tools/typespec-client-generator-core@0.54.0-dev.22(llvaf3qoefvnsvhamv54x3g4pe))(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)) '@azure-tools/typespec-client-generator-core': - specifier: ~0.54.0-dev.19 - version: 0.54.0-dev.19(bi3uo6v4m3cwrf7tvdzqjmlfka) + specifier: 0.54.0-dev.22 + version: 0.54.0-dev.22(llvaf3qoefvnsvhamv54x3g4pe) '@types/fs-extra': specifier: 11.0.4 version: 11.0.4 @@ -119,8 +119,8 @@ importers: specifier: ~4.0.5 version: 4.0.9 '@types/node': - specifier: ~22.5.4 - version: 22.5.5 + specifier: ~22.13.14 + version: 22.13.17 '@types/semver': specifier: 7.5.8 version: 7.5.8 @@ -128,32 +128,38 @@ importers: specifier: ~17.0.33 version: 17.0.33 '@typespec/compiler': - specifier: ~0.68.0-dev.11 - version: 0.68.0-dev.12(@types/node@22.5.5) + specifier: 0.68.0-dev.13 + version: 0.68.0-dev.13(@types/node@22.13.17) '@typespec/events': - specifier: ~0.68.0-dev.2 - version: 0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)) + specifier: ~0.68.0-dev.3 + version: 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)) '@typespec/http': - specifier: ~0.68.0-dev.8 - version: 0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))) + specifier: 0.68.0-dev.9 + version: 0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))) '@typespec/http-specs': - specifier: 0.1.0-alpha.17-dev.1 - version: 0.1.0-alpha.17-dev.1(@types/node@22.5.5)(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))(@typespec/rest@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)))))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)))(@typespec/versioning@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)))(@typespec/xml@0.59.0(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))) + specifier: 0.1.0-alpha.17-dev.2 + version: 0.1.0-alpha.17-dev.2(@types/node@22.13.17)(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))))(@typespec/rest@0.68.0-dev.4(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)))))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)))(@typespec/versioning@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)))(@typespec/xml@0.59.0(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))) '@typespec/openapi': - specifier: ~0.68.0-dev.3 - version: 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)))) + specifier: 0.68.0-dev.3 + version: 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)))) '@typespec/rest': - specifier: ~0.68.0-dev.3 - version: 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)))) + specifier: 0.68.0-dev.4 + version: 0.68.0-dev.4(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)))) + '@typespec/spec-api': + specifier: 0.1.0-alpha.4-dev.0 + version: 0.1.0-alpha.4-dev.0 + '@typespec/spector': + specifier: 0.1.0-alpha.11-dev.2 + version: 0.1.0-alpha.11-dev.2(@types/node@22.13.17)(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))) '@typespec/sse': - specifier: ~0.68.0-dev.2 - version: 0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/events@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))) + specifier: ~0.68.0-dev.3 + version: 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/events@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))) '@typespec/streams': - specifier: ~0.68.0-dev.2 - version: 0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)) + specifier: ~0.68.0-dev.3 + version: 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)) '@typespec/versioning': - specifier: ~0.68.0-dev.2 - version: 0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)) + specifier: 0.68.0-dev.3 + version: 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)) c8: specifier: ^10.1.3 version: 10.1.3 @@ -164,14 +170,14 @@ importers: specifier: ~6.0.1 version: 6.0.1 typescript: - specifier: ~5.7.3 - version: 5.7.3 + specifier: ~5.8.2 + version: 5.8.2 typescript-eslint: specifier: ^8.21.0 - version: 8.26.0(eslint@9.11.1)(typescript@5.7.3) + version: 8.26.0(eslint@9.11.1)(typescript@5.8.2) vitest: specifier: ^3.0.5 - version: 3.0.8(@types/node@22.5.5) + version: 3.0.8(@types/node@22.13.17) yargs: specifier: ~17.7.2 version: 17.7.2 @@ -188,8 +194,8 @@ packages: resolution: {integrity: sha512-T21naRb6JDdjjn2s/zwr9iCIv/9jviL/PRtiWAhi+3UA2WKH2wrId2VqJa4uVD7iEV8BLkuGgFmMkaMBG26hFw==} engines: {node: '>=12.0.0'} - '@azure-tools/azure-http-specs@0.1.0-alpha.13-dev.1': - resolution: {integrity: sha512-qsG3Vdk7/IP+Bl4w1m6EoSvKu+jVZDVmmOSZDGnSYNMy9qF0OCDyZAn9lSahBYNNsU+N1c2uZWaSt1OfcDiE9w==} + '@azure-tools/azure-http-specs@0.1.0-alpha.13-dev.2': + resolution: {integrity: sha512-CQc0bk3YKjnhp1DI4u9NVBm1imkNJNxUjO98JbR6/rQP6OblJCmE4bYG5ahtAYaSlceJaAn5K89TTDhcoMZJkg==} engines: {node: '>=20.0.0'} peerDependencies: '@azure-tools/typespec-azure-core': ^0.53.0 || >=0.54.0-dev <0.54.0 @@ -220,8 +226,8 @@ packages: '@typespec/http': ^0.67.1 || >=0.68.0-dev <0.68.0 '@typespec/rest': ^0.67.1 || >=0.68.0-dev <0.68.0 - '@azure-tools/typespec-azure-resource-manager@0.54.0-dev.3': - resolution: {integrity: sha512-HMAjd1AnZyFj3uVees0qy5BNFxRrlTT3XZQA2d8uEVbESlLBQrkX1z3AwJvaNnM7HoBmjYxs9BsTI9mg/jvRGg==} + '@azure-tools/typespec-azure-resource-manager@0.54.0-dev.4': + resolution: {integrity: sha512-P5a4m2umzEse3/VwgrRvJSQVoaqWW7TfsuYcFvFr+qhr7cHhmfROoOcZAf2fO26kQa7HQX0x5T/2iGT9YP7l1w==} engines: {node: '>=20.0.0'} peerDependencies: '@azure-tools/typespec-azure-core': ^0.53.0 || >=0.54.0-dev <0.54.0 @@ -240,8 +246,8 @@ packages: '@azure-tools/typespec-client-generator-core': ^0.53.1 || >=0.54.0-dev <0.54.0 '@typespec/compiler': ^0.67.1 || >=0.68.0-dev <0.68.0 - '@azure-tools/typespec-client-generator-core@0.54.0-dev.19': - resolution: {integrity: sha512-sMCAtM9AMH6BuE4r4P5G3LVpon5YFfTQgPeSCYlAVpOxNdnx4g2qFFuE1Lsb1lHfHVPU3ZLRlGfFtOcJWLN1/Q==} + '@azure-tools/typespec-client-generator-core@0.54.0-dev.22': + resolution: {integrity: sha512-BzI1pt7vuInUyCLH8QpZWqko9q5a53ch4gg4zGBQk0K/nfMPh0xzVeCYyYTDqpxAjyUqjei+JLo4W8u21yiXiw==} engines: {node: '>=20.0.0'} peerDependencies: '@azure-tools/typespec-azure-core': ^0.53.0 || >=0.54.0-dev <0.54.0 @@ -891,15 +897,6 @@ packages: resolution: {integrity: sha512-d2CGZR2o7fS6sWB7DG/3a95bGKQyHMACZ5aW8qGkkqQpUoZV6C0X7Pc7l4ZNMZkfNBf4VWNe9E1jRsf0G146Ew==} engines: {node: '>=18.18'} - '@inquirer/checkbox@4.1.2': - resolution: {integrity: sha512-PL9ixC5YsPXzXhAZFUPmkXGxfgjkdfZdPEPPmt4kFwQ4LBMDG9n/nHXYRGGZSKZJs+d1sGKWgS2GiPzVRKUdtQ==} - engines: {node: '>=18'} - peerDependencies: - '@types/node': '>=18' - peerDependenciesMeta: - '@types/node': - optional: true - '@inquirer/checkbox@4.1.4': resolution: {integrity: sha512-d30576EZdApjAMceijXA5jDzRQHT/MygbC+J8I7EqA6f/FRpYxlRtRJbHF8gHeWYeSdOuTEJqonn7QLB1ELezA==} engines: {node: '>=18'} @@ -909,15 +906,6 @@ packages: '@types/node': optional: true - '@inquirer/confirm@5.1.6': - resolution: {integrity: sha512-6ZXYK3M1XmaVBZX6FCfChgtponnL0R6I7k8Nu+kaoNkT828FVZTcca1MqmWQipaW2oNREQl5AaPCUOOCVNdRMw==} - engines: {node: '>=18'} - peerDependencies: - '@types/node': '>=18' - peerDependenciesMeta: - '@types/node': - optional: true - '@inquirer/confirm@5.1.8': resolution: {integrity: sha512-dNLWCYZvXDjO3rnQfk2iuJNL4Ivwz/T2+C3+WnNfJKsNGSuOs3wAo2F6e0p946gtSAk31nZMfW+MRmYaplPKsg==} engines: {node: '>=18'} @@ -927,15 +915,6 @@ packages: '@types/node': optional: true - '@inquirer/core@10.1.7': - resolution: {integrity: sha512-AA9CQhlrt6ZgiSy6qoAigiA1izOa751ugX6ioSjqgJ+/Gd+tEN/TORk5sUYNjXuHWfW0r1n/a6ak4u/NqHHrtA==} - engines: {node: '>=18'} - peerDependencies: - '@types/node': '>=18' - peerDependenciesMeta: - '@types/node': - optional: true - '@inquirer/core@10.1.9': resolution: {integrity: sha512-sXhVB8n20NYkUBfDYgizGHlpRVaCRjtuzNZA6xpALIUbkgfd2Hjz+DfEN6+h1BRnuxw0/P4jCIMjMsEOAMwAJw==} engines: {node: '>=18'} @@ -945,15 +924,6 @@ packages: '@types/node': optional: true - '@inquirer/editor@4.2.7': - resolution: {integrity: sha512-gktCSQtnSZHaBytkJKMKEuswSk2cDBuXX5rxGFv306mwHfBPjg5UAldw9zWGoEyvA9KpRDkeM4jfrx0rXn0GyA==} - engines: {node: '>=18'} - peerDependencies: - '@types/node': '>=18' - peerDependenciesMeta: - '@types/node': - optional: true - '@inquirer/editor@4.2.9': resolution: {integrity: sha512-8HjOppAxO7O4wV1ETUlJFg6NDjp/W2NP5FB9ZPAcinAlNT4ZIWOLe2pUVwmmPRSV0NMdI5r/+lflN55AwZOKSw==} engines: {node: '>=18'} @@ -972,32 +942,10 @@ packages: '@types/node': optional: true - '@inquirer/expand@4.0.9': - resolution: {integrity: sha512-Xxt6nhomWTAmuSX61kVgglLjMEFGa+7+F6UUtdEUeg7fg4r9vaFttUUKrtkViYYrQBA5Ia1tkOJj2koP9BuLig==} - engines: {node: '>=18'} - peerDependencies: - '@types/node': '>=18' - peerDependenciesMeta: - '@types/node': - optional: true - - '@inquirer/figures@1.0.10': - resolution: {integrity: sha512-Ey6176gZmeqZuY/W/nZiUyvmb1/qInjcpiZjXWi6nON+nxJpD1bxtSoBxNliGISae32n6OwbY+TSXPZ1CfS4bw==} - engines: {node: '>=18'} - '@inquirer/figures@1.0.11': resolution: {integrity: sha512-eOg92lvrn/aRUqbxRyvpEWnrvRuTYRifixHkYVpJiygTgVSBIHDqLh0SrMQXkafvULg3ck11V7xvR+zcgvpHFw==} engines: {node: '>=18'} - '@inquirer/input@4.1.6': - resolution: {integrity: sha512-1f5AIsZuVjPT4ecA8AwaxDFNHny/tSershP/cTvTDxLdiIGTeILNcKozB0LaYt6mojJLUbOYhpIxicaYf7UKIQ==} - engines: {node: '>=18'} - peerDependencies: - '@types/node': '>=18' - peerDependenciesMeta: - '@types/node': - optional: true - '@inquirer/input@4.1.8': resolution: {integrity: sha512-WXJI16oOZ3/LiENCAxe8joniNp8MQxF6Wi5V+EBbVA0ZIOpFcL4I9e7f7cXse0HJeIPCWO8Lcgnk98juItCi7Q==} engines: {node: '>=18'} @@ -1016,15 +964,6 @@ packages: '@types/node': optional: true - '@inquirer/number@3.0.9': - resolution: {integrity: sha512-iN2xZvH3tyIYXLXBvlVh0npk1q/aVuKXZo5hj+K3W3D4ngAEq/DkLpofRzx6oebTUhBvOgryZ+rMV0yImKnG3w==} - engines: {node: '>=18'} - peerDependencies: - '@types/node': '>=18' - peerDependenciesMeta: - '@types/node': - optional: true - '@inquirer/password@4.0.11': resolution: {integrity: sha512-dH6zLdv+HEv1nBs96Case6eppkRggMe8LoOTl30+Gq5Wf27AO/vHFgStTVz4aoevLdNXqwE23++IXGw4eiOXTg==} engines: {node: '>=18'} @@ -1034,24 +973,6 @@ packages: '@types/node': optional: true - '@inquirer/password@4.0.9': - resolution: {integrity: sha512-xBEoOw1XKb0rIN208YU7wM7oJEHhIYkfG7LpTJAEW913GZeaoQerzf5U/LSHI45EVvjAdgNXmXgH51cUXKZcJQ==} - engines: {node: '>=18'} - peerDependencies: - '@types/node': '>=18' - peerDependenciesMeta: - '@types/node': - optional: true - - '@inquirer/prompts@7.3.2': - resolution: {integrity: sha512-G1ytyOoHh5BphmEBxSwALin3n1KGNYB6yImbICcRQdzXfOGbuJ9Jske/Of5Sebk339NSGGNfUshnzK8YWkTPsQ==} - engines: {node: '>=18'} - peerDependencies: - '@types/node': '>=18' - peerDependenciesMeta: - '@types/node': - optional: true - '@inquirer/prompts@7.4.0': resolution: {integrity: sha512-EZiJidQOT4O5PYtqnu1JbF0clv36oW2CviR66c7ma4LsupmmQlUwmdReGKRp456OWPWMz3PdrPiYg3aCk3op2w==} engines: {node: '>=18'} @@ -1070,15 +991,6 @@ packages: '@types/node': optional: true - '@inquirer/rawlist@4.0.9': - resolution: {integrity: sha512-+5t6ebehKqgoxV8fXwE49HkSF2Rc9ijNiVGEQZwvbMI61/Q5RcD+jWD6Gs1tKdz5lkI8GRBL31iO0HjGK1bv+A==} - engines: {node: '>=18'} - peerDependencies: - '@types/node': '>=18' - peerDependenciesMeta: - '@types/node': - optional: true - '@inquirer/search@3.0.11': resolution: {integrity: sha512-9CWQT0ikYcg6Ls3TOa7jljsD7PgjcsYEM0bYE+Gkz+uoW9u8eaJCRHJKkucpRE5+xKtaaDbrND+nPDoxzjYyew==} engines: {node: '>=18'} @@ -1088,24 +1000,6 @@ packages: '@types/node': optional: true - '@inquirer/search@3.0.9': - resolution: {integrity: sha512-DWmKztkYo9CvldGBaRMr0ETUHgR86zE6sPDVOHsqz4ISe9o1LuiWfgJk+2r75acFclA93J/lqzhT0dTjCzHuoA==} - engines: {node: '>=18'} - peerDependencies: - '@types/node': '>=18' - peerDependenciesMeta: - '@types/node': - optional: true - - '@inquirer/select@4.0.9': - resolution: {integrity: sha512-BpJyJe7Dkhv2kz7yG7bPSbJLQuu/rqyNlF1CfiiFeFwouegfH+zh13KDyt6+d9DwucKo7hqM3wKLLyJxZMO+Xg==} - engines: {node: '>=18'} - peerDependencies: - '@types/node': '>=18' - peerDependenciesMeta: - '@types/node': - optional: true - '@inquirer/select@4.1.0': resolution: {integrity: sha512-z0a2fmgTSRN+YBuiK1ROfJ2Nvrpij5lVN3gPDkQGhavdvIVGHGW29LwYZfM/j42Ai2hUghTI/uoBuTbrJk42bA==} engines: {node: '>=18'} @@ -1115,15 +1009,6 @@ packages: '@types/node': optional: true - '@inquirer/type@3.0.4': - resolution: {integrity: sha512-2MNFrDY8jkFYc9Il9DgLsHhMzuHnOYM1+CUYVWbzu9oT0hC7V7EcYvdCKeoll/Fcci04A+ERZ9wcc7cQ8lTkIA==} - engines: {node: '>=18'} - peerDependencies: - '@types/node': '>=18' - peerDependenciesMeta: - '@types/node': - optional: true - '@inquirer/type@3.0.5': resolution: {integrity: sha512-ZJpeIYYueOz/i/ONzrfof8g89kNdO2hjGuvULROo3O8rlB2CRtSseE5KeirnyE4t/thAn/EwvS/vuQeJCn+NZg==} engines: {node: '>=18'} @@ -1518,11 +1403,8 @@ packages: '@types/jsonfile@6.1.4': resolution: {integrity: sha512-D5qGUYwjvnNNextdU59/+fI+spnwtTFmyQP0h+PfIOSkNfpU6AOICUOkm4i0OnSk+NyjdPJrxCDro0sJsWlRpQ==} - '@types/node@22.13.10': - resolution: {integrity: sha512-I6LPUvlRH+O6VRUqYOcMudhaIdUVWfsjnZavnsraHvpBwaEyMN29ry+0UVJhImYL16xsscu0aske3yA+uPOWfw==} - - '@types/node@22.5.5': - resolution: {integrity: sha512-Xjs4y5UPO/CLdzpgR6GirZJx36yScjh73+2NlLlkFRSoQN8B0DpfXPdZGnvVmLRLOsqDpOfTNv7D9trgGhmOIA==} + '@types/node@22.13.17': + resolution: {integrity: sha512-nAJuQXoyPj04uLgu+obZcSmsfOenUg6DxPKogeUy6yNCFwWaj5sBF8/G/pNo8EtBJjAfSVgfIlugR/BCOleO+g==} '@types/normalize-package-data@2.4.4': resolution: {integrity: sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==} @@ -1643,43 +1525,38 @@ packages: resolution: {integrity: sha512-b1tx0orFCCh/THWPQa2ZwWzvOeyzzp36vkJYOpVg0u8UVOIsfVrnuC9FqAw9gRKn+rG2VmWQ/zDJZzkxUnj/XQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@typespec/compiler@0.67.2': - resolution: {integrity: sha512-6c47359nR6IjI4fYq+0hi1mm9GMdHQ/LdqPa/roKg1wQaBohUMBJXW7duMDcz2BTorYjoEBYalz9olMG4oqZDA==} + '@typespec/compiler@0.68.0-dev.13': + resolution: {integrity: sha512-7lqlsRHQH2irv15fH4ACbS4DutqCfesb9Nju5wMt4aHUHIzo3AT1pjc8ZzlpHJBcDravissntk4U7sW0ctqxTQ==} engines: {node: '>=20.0.0'} hasBin: true - '@typespec/compiler@0.68.0-dev.12': - resolution: {integrity: sha512-Sl8eNWOUYytWZ7PjjIi7V9ZkGbp5+e2Ja3YSLrFYQ2fRaUIgWPS+Pc4Cw18iQgg7E+Uc4tvdRtziT7z1nZqCiw==} - engines: {node: '>=20.0.0'} - hasBin: true - - '@typespec/events@0.68.0-dev.2': - resolution: {integrity: sha512-Vplgg6Za7gh4gxYKrhVz2AEAmv0BiE/xYxyLPdt0yChS07hhfhVC1a3Fw8pAX30AJqnMKV4YX9177axA58SZzw==} + '@typespec/events@0.68.0-dev.3': + resolution: {integrity: sha512-BhZtrLxTIbGXZfLae4YcfXgw3ijBlyNFJEckKrH9jgKjZyE6ybQ3BxgAJGSNMRGykx+gBJJOnpDgHRt+ATg+/g==} engines: {node: '>=20.0.0'} peerDependencies: - '@typespec/compiler': ^0.67.1 || >=0.68.0-dev <0.68.0 + '@typespec/compiler': ^0.67.2 || >=0.68.0-dev <0.68.0 - '@typespec/http-client-python@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcwOTg1Ny9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.2.tgz': - resolution: {tarball: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcwOTg1Ny9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.2.tgz} + '@typespec/http-client-python@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcxNDA2NS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.2.tgz': + resolution: {tarball: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcxNDA2NS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.2.tgz} version: 0.8.2 engines: {node: '>=20.0.0'} peerDependencies: - '@azure-tools/typespec-autorest': '>=0.54.0-dev.5 <1.0.0' - '@azure-tools/typespec-azure-core': '>=0.54.0-dev.5 <1.0.0' - '@azure-tools/typespec-azure-resource-manager': '>=0.54.0-dev.3 <1.0.0' - '@azure-tools/typespec-azure-rulesets': '>=0.54.0-dev.2 <3.0.0' - '@azure-tools/typespec-client-generator-core': '>=0.54.0-dev.19 <1.0.0' - '@typespec/compiler': '>=0.68.0-dev.11 <1.0.0' - '@typespec/events': '>=0.68.0-dev.2 <1.0.0' - '@typespec/http': '>=0.68.0-dev.8 <1.0.0' - '@typespec/openapi': '>=0.68.0-dev.3 <1.0.0' - '@typespec/rest': '>=0.68.0-dev.3 <1.0.0' - '@typespec/sse': '>=0.68.0-dev.2 <1.0.0' - '@typespec/streams': '>=0.68.0-dev.2 <1.0.0' - '@typespec/versioning': '>=0.68.0-dev.2 <1.0.0' - - '@typespec/http-specs@0.1.0-alpha.17-dev.1': - resolution: {integrity: sha512-OpKCqt/deTme51fktbEBzJ7D6ZaS69vXjhLqdvbMBGPJxjLtLMY53pmv+xOA9I0IWLvavlPD4BXEYysIwshufA==} + '@azure-tools/typespec-autorest': 0.54.0-dev.5 + '@azure-tools/typespec-azure-core': 0.54.0-dev.5 + '@azure-tools/typespec-azure-resource-manager': 0.54.0-dev.4 + '@azure-tools/typespec-azure-rulesets': 0.54.0-dev.2 + '@azure-tools/typespec-client-generator-core': 0.54.0-dev.22 + '@typespec/compiler': 0.68.0-dev.13 + '@typespec/events': '>=0.68.0-dev.3 <1.0.0' + '@typespec/http': 0.68.0-dev.9 + '@typespec/openapi': 0.68.0-dev.3 + '@typespec/rest': 0.68.0-dev.4 + '@typespec/sse': '>=0.68.0-dev.3 <1.0.0' + '@typespec/streams': '>=0.68.0-dev.3 <1.0.0' + '@typespec/versioning': 0.68.0-dev.3 + + '@typespec/http-specs@0.1.0-alpha.17-dev.2': + resolution: {integrity: sha512-AOscz0jFO76pbv+FU9pnFIr7ec794qqF6lUubKrABJtb7MwMdaS5/0fkA2pbgvlR/8OyfqiqXeCB4Aoqg51n3g==} engines: {node: '>=16.0.0'} peerDependencies: '@typespec/compiler': ^0.67.2 || >=0.68.0-dev <0.68.0 @@ -1688,18 +1565,8 @@ packages: '@typespec/versioning': ^0.67.1 || >=0.68.0-dev <0.68.0 '@typespec/xml': ^0.67.1 || >=0.68.0-dev <0.68.0 - '@typespec/http@0.67.1': - resolution: {integrity: sha512-pkLFdKLA5ObCptUuwL8mhiy6EqVbqmtvHK89zqiTfYYGw2qm76+EUHaK0P/g2aAmjcwlrDGhJ0EhzbVp87H0mg==} - engines: {node: '>=20.0.0'} - peerDependencies: - '@typespec/compiler': ^0.67.1 - '@typespec/streams': ^0.67.1 - peerDependenciesMeta: - '@typespec/streams': - optional: true - - '@typespec/http@0.68.0-dev.8': - resolution: {integrity: sha512-A1IcrANbTYVhR4bjrsjI2UJ5PpkvFwcn/w9nZnjrQ74lDOx171HmcSRKpUzQFSskW9f/iOaWwj8f79rOtHnY3g==} + '@typespec/http@0.68.0-dev.9': + resolution: {integrity: sha512-p4pjqhY2EPzhBLmS0ohaZaYwJdezXgeUKQNrhzHR8ckt7qWkOOXNggPngPiXTVxgxYwAM5Zi/BvWrUxMbiqU3g==} engines: {node: '>=20.0.0'} peerDependencies: '@typespec/compiler': ^0.67.2 || >=0.68.0-dev <0.68.0 @@ -1715,59 +1582,46 @@ packages: '@typespec/compiler': ^0.67.2 || >=0.68.0-dev <0.68.0 '@typespec/http': ^0.67.1 || >=0.68.0-dev <0.68.0 - '@typespec/rest@0.67.1': - resolution: {integrity: sha512-19IzFoaM0yFBSXpfrJgZEBVXtvEkMEprKc5B0kF4ylEPs32ShtZj05BXYrAkmMZbCsk0AC/VZdmVgcWP+AT6GQ==} + '@typespec/rest@0.68.0-dev.4': + resolution: {integrity: sha512-Sov7HNQr5IBfu0wbkY3pxUFLPb13ptW2cu/F1Ix1HwIzJ+6045A5vtaeOu5zAwPojDgcmTvsY8qBgTeYbfeiJg==} engines: {node: '>=20.0.0'} peerDependencies: - '@typespec/compiler': ^0.67.1 - '@typespec/http': ^0.67.1 - - '@typespec/rest@0.68.0-dev.3': - resolution: {integrity: sha512-Wwm+UlFuUMUJ2gkdEKDMiYve1MLfYpEP2fgF+9HwhrMIagDw7C/Jgt3o3PTRvonD5SKx1n5wne4/EL+K8Q0F4A==} - engines: {node: '>=20.0.0'} - peerDependencies: - '@typespec/compiler': ^0.67.1 || >=0.68.0-dev <0.68.0 + '@typespec/compiler': ^0.67.2 || >=0.68.0-dev <0.68.0 '@typespec/http': ^0.67.1 || >=0.68.0-dev <0.68.0 - '@typespec/spec-api@0.1.0-alpha.3-dev.0': - resolution: {integrity: sha512-zMozvoCEDERYvGMgT2EvuNyIcaFvf3pUXWhc7jyhJK2zI0z2ELnT4gUEynJ3ugI/ICaWtxHrGkwueaf508a5gQ==} + '@typespec/spec-api@0.1.0-alpha.4-dev.0': + resolution: {integrity: sha512-vXYeLX4YpHzcP4YFbuM4AU8GnRbjf7ZrJ6qeaI5XHieroEdkQUUGolpd2eEaokUbmVaek5ZX6EuEZjTjM/DTpg==} engines: {node: '>=20.0.0'} '@typespec/spec-coverage-sdk@0.1.0-alpha.5-dev.0': resolution: {integrity: sha512-I0p1ogrB3hW16K9IJyxFUz6AvuQ8NDsiLrav5ujGGJbW3gXdp+N6MzxXp5NNs4jfHoryX4kkA7xlTiPqKz3Pcw==} engines: {node: '>=16.0.0'} - '@typespec/spector@0.1.0-alpha.10': - resolution: {integrity: sha512-2M/LwXh+YKf0lT9tLV5a9OSI99g8X8ZeyHIUUenddE99gFqi41ql92k1LW/CT1jz4/pmoXMnWx3L+U439EXcHg==} + '@typespec/spector@0.1.0-alpha.11-dev.2': + resolution: {integrity: sha512-dlVKSECFDddsKcRpuaB81Sd6krpGMH7q6E212ast5UVjt+JhJK2Egqy+F/ys3tNdgTW3PFkhqeIbiU52JNOWGg==} engines: {node: '>=16.0.0'} hasBin: true - '@typespec/sse@0.68.0-dev.2': - resolution: {integrity: sha512-tK5R8F6tihUx5jbuMeFFrKRecV2HIkBD+v4CH/ofPZi+2dtIZe9UxEOeRPezJ1nollfwwd3v2aGihPG6nNl1Kw==} + '@typespec/sse@0.68.0-dev.3': + resolution: {integrity: sha512-XaTLVAIZ0ZxZ5nKP5LmXk0x+VS1pNUXi32TzzF1fQMFNMTvIQXv7JKgZkw9rMPE1sQf6pq0kfw2Hfikn+2SPDw==} engines: {node: '>=20.0.0'} peerDependencies: - '@typespec/compiler': ^0.67.1 || >=0.68.0-dev <0.68.0 + '@typespec/compiler': ^0.67.2 || >=0.68.0-dev <0.68.0 '@typespec/events': ^0.67.1 || >=0.68.0-dev <0.68.0 '@typespec/http': ^0.67.1 || >=0.68.0-dev <0.68.0 '@typespec/streams': ^0.67.1 || >=0.68.0-dev <0.68.0 - '@typespec/streams@0.68.0-dev.2': - resolution: {integrity: sha512-wsy6uONEST8iLFznLpM/OSmP1WxQajK4oN+f0UNJz+Q3gJseH8P8K3WvCO8qN8oYBAR4LjMk06diFTnfT3zrWQ==} - engines: {node: '>=20.0.0'} - peerDependencies: - '@typespec/compiler': ^0.67.1 || >=0.68.0-dev <0.68.0 - - '@typespec/versioning@0.67.1': - resolution: {integrity: sha512-i1eZT8JlCthkRHJS3NH/nZTHUD7gJozP6pVy8wyHBx6TbnDOTfQ1P5YVlL2pF4ZdeRbGFhOKiUF/usEIOrkaVw==} + '@typespec/streams@0.68.0-dev.3': + resolution: {integrity: sha512-p5HWk0WyEqjuFEuHa/3Ea5zuebm9ZuummnTbkv+qPusiwv/6va8Bb4m4jzJfzBsz1eETtcr+2i64KGEIg/kXqQ==} engines: {node: '>=20.0.0'} peerDependencies: - '@typespec/compiler': ^0.67.1 + '@typespec/compiler': ^0.67.2 || >=0.68.0-dev <0.68.0 - '@typespec/versioning@0.68.0-dev.2': - resolution: {integrity: sha512-MUKf6peqW0aqOqGd2UaLLGg+prJ2ZSsyGoa0JkRfZFgu8n6z2BnqCZkCpppdimUx4s87wXBwCGKnQ4ECUTAZ0A==} + '@typespec/versioning@0.68.0-dev.3': + resolution: {integrity: sha512-shhujRKXKEELOwQ54dbzhtttkYCh8yPwDriZ/KQSprPO1SGInhjVxhzZaIx0Qaz+41Xxs53Ay96b/40eNXGLAg==} engines: {node: '>=20.0.0'} peerDependencies: - '@typespec/compiler': ^0.67.1 || >=0.68.0-dev <0.68.0 + '@typespec/compiler': ^0.67.2 || >=0.68.0-dev <0.68.0 '@typespec/xml@0.59.0': resolution: {integrity: sha512-UoSsEmm7SXEtL9OXsqotu1TjruJSobqZMhUKAAlC9EP2WfQIHLRfBu7xaZB0sgwq7CM6zy/Hq1RZfQyL1KqEvg==} @@ -3369,10 +3223,6 @@ packages: ms@2.1.3: resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} - multer@1.4.5-lts.1: - resolution: {integrity: sha512-ywPWvcDMeH+z9gQq5qYHCCy+ethsk4goepZ45GLD63fOu0YcNecQxi64nDs3qluZB+murG3/D4dJ7+dGctcCQQ==} - engines: {node: '>= 6.0.0'} - multer@1.4.5-lts.2: resolution: {integrity: sha512-VzGiVigcG9zUAoCNU+xShztrlr1auZOlurXynNvO9GiWD1/mTBbUljOKY+qMeazBqXgRnjzeEgJI/wyjJUHg9A==} engines: {node: '>= 6.0.0'} @@ -4235,8 +4085,8 @@ packages: engines: {node: '>=14.17'} hasBin: true - typescript@5.7.3: - resolution: {integrity: sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw==} + typescript@5.8.2: + resolution: {integrity: sha512-aJn6wq13/afZp/jT9QZmwEjDqqvSGp1VT5GVg+f/t6/oVyrgXM6BY1h9BRh/O5p3PlUPAe+WuiEZOmb/49RqoQ==} engines: {node: '>=14.17'} hasBin: true @@ -4246,9 +4096,6 @@ packages: underscore@1.13.7: resolution: {integrity: sha512-GMXzWtsc57XAtguZgaQViUOzs0KTkk8ojr3/xAxXLITqf/3EMwxC0inyETfDFjH/Krbhuep0HNbbjI9i/q3F3g==} - undici-types@6.19.8: - resolution: {integrity: sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==} - undici-types@6.20.0: resolution: {integrity: sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==} @@ -4452,10 +4299,6 @@ packages: resolution: {integrity: sha512-CO8cdpBB2yqzEf8v895L+GNKYJiEq8eKlHU38af3snQBQ+sdAIUepjMSguOIJC7ICbzm0ZI+Af2If4vIJrtmOg==} engines: {node: '>= 12.0.0'} - winston@3.17.0: - resolution: {integrity: sha512-DLiFIXYC5fMPxaRg832S6F5mJYvePtmO5G9v9IgUFPhXm9/GkXarH/TUrBAVzhTCzAj9anE/+GjrgXp/54nOgw==} - engines: {node: '>= 12.0.0'} - word-wrap@1.2.5: resolution: {integrity: sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==} engines: {node: '>=0.10.0'} @@ -4570,120 +4413,68 @@ snapshots: command-exists: 1.2.9 semver: 7.6.3 - '@azure-tools/azure-http-specs@0.1.0-alpha.13-dev.1(dkz3jopup3kcww2tc3n27h5adi)': + '@azure-tools/azure-http-specs@0.1.0-alpha.13-dev.2(2qclodw5tqlmu4xopqkjoaoqw4)': dependencies: - '@azure-tools/typespec-azure-core': 0.54.0-dev.5(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))(@typespec/rest@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))) - '@typespec/compiler': 0.68.0-dev.12(@types/node@22.5.5) - '@typespec/http': 0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))) - '@typespec/rest': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)))) - '@typespec/spec-api': 0.1.0-alpha.3-dev.0 - '@typespec/spector': 0.1.0-alpha.10(@types/node@22.5.5)(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))) - '@typespec/versioning': 0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)) - '@typespec/xml': 0.59.0(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)) + '@azure-tools/typespec-azure-core': 0.54.0-dev.5(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))))(@typespec/rest@0.68.0-dev.4(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))))) + '@typespec/compiler': 0.68.0-dev.13(@types/node@22.13.17) + '@typespec/http': 0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))) + '@typespec/rest': 0.68.0-dev.4(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)))) + '@typespec/spec-api': 0.1.0-alpha.4-dev.0 + '@typespec/spector': 0.1.0-alpha.11-dev.2(@types/node@22.13.17)(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))) + '@typespec/versioning': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)) + '@typespec/xml': 0.59.0(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)) transitivePeerDependencies: - - '@types/express' - '@types/node' - '@typespec/streams' - supports-color - '@azure-tools/typespec-autorest@0.54.0-dev.5(sc7idhpgkzao6ca27f5n4spwdm)': - dependencies: - '@azure-tools/typespec-azure-core': 0.54.0-dev.5(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))))(@typespec/rest@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))))) - '@azure-tools/typespec-azure-resource-manager': 0.54.0-dev.3(v3vj4toze5ay2f53uheih2fore) - '@azure-tools/typespec-client-generator-core': 0.54.0-dev.19(x4iqah4tm4sou6fo55o2ec4yze) - '@typespec/compiler': 0.68.0-dev.12(@types/node@22.13.10) - '@typespec/http': 0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))) - '@typespec/openapi': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10)))) - '@typespec/rest': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10)))) - '@typespec/versioning': 0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10)) - - '@azure-tools/typespec-autorest@0.54.0-dev.5(terlvcbdqtyv3m5pmsko2l6fny)': - dependencies: - '@azure-tools/typespec-azure-core': 0.54.0-dev.5(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))(@typespec/rest@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))) - '@azure-tools/typespec-azure-resource-manager': 0.54.0-dev.3(vvsjt7ss6dhpuzy2lahlecfu7a) - '@azure-tools/typespec-client-generator-core': 0.54.0-dev.19(bi3uo6v4m3cwrf7tvdzqjmlfka) - '@typespec/compiler': 0.68.0-dev.12(@types/node@22.5.5) - '@typespec/http': 0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))) - '@typespec/openapi': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)))) - '@typespec/rest': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)))) - '@typespec/versioning': 0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)) - - '@azure-tools/typespec-azure-core@0.54.0-dev.5(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))))(@typespec/rest@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10)))))': - dependencies: - '@typespec/compiler': 0.68.0-dev.12(@types/node@22.13.10) - '@typespec/http': 0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))) - '@typespec/rest': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10)))) - - '@azure-tools/typespec-azure-core@0.54.0-dev.5(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))(@typespec/rest@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)))))': - dependencies: - '@typespec/compiler': 0.68.0-dev.12(@types/node@22.5.5) - '@typespec/http': 0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))) - '@typespec/rest': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)))) - - '@azure-tools/typespec-azure-resource-manager@0.54.0-dev.3(v3vj4toze5ay2f53uheih2fore)': - dependencies: - '@azure-tools/typespec-azure-core': 0.54.0-dev.5(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))))(@typespec/rest@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))))) - '@typespec/compiler': 0.68.0-dev.12(@types/node@22.13.10) - '@typespec/http': 0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))) - '@typespec/openapi': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10)))) - '@typespec/rest': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10)))) - '@typespec/versioning': 0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10)) - change-case: 5.4.4 - pluralize: 8.0.0 - - '@azure-tools/typespec-azure-resource-manager@0.54.0-dev.3(vvsjt7ss6dhpuzy2lahlecfu7a)': - dependencies: - '@azure-tools/typespec-azure-core': 0.54.0-dev.5(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))(@typespec/rest@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))) - '@typespec/compiler': 0.68.0-dev.12(@types/node@22.5.5) - '@typespec/http': 0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))) - '@typespec/openapi': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)))) - '@typespec/rest': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)))) - '@typespec/versioning': 0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)) - change-case: 5.4.4 - pluralize: 8.0.0 - - '@azure-tools/typespec-azure-rulesets@0.54.0-dev.2(@azure-tools/typespec-azure-core@0.54.0-dev.5(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))))(@typespec/rest@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))))))(@azure-tools/typespec-azure-resource-manager@0.54.0-dev.3(v3vj4toze5ay2f53uheih2fore))(@azure-tools/typespec-client-generator-core@0.54.0-dev.19(x4iqah4tm4sou6fo55o2ec4yze))(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))': + '@azure-tools/typespec-autorest@0.54.0-dev.5(slqx2jlvr2rb5u5z3itjv7na4u)': dependencies: - '@azure-tools/typespec-azure-core': 0.54.0-dev.5(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))))(@typespec/rest@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))))) - '@azure-tools/typespec-azure-resource-manager': 0.54.0-dev.3(v3vj4toze5ay2f53uheih2fore) - '@azure-tools/typespec-client-generator-core': 0.54.0-dev.19(x4iqah4tm4sou6fo55o2ec4yze) - '@typespec/compiler': 0.68.0-dev.12(@types/node@22.13.10) + '@azure-tools/typespec-azure-core': 0.54.0-dev.5(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))))(@typespec/rest@0.68.0-dev.4(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))))) + '@azure-tools/typespec-azure-resource-manager': 0.54.0-dev.4(qb3xdiittordn2dqsr2n6il7zy) + '@azure-tools/typespec-client-generator-core': 0.54.0-dev.22(llvaf3qoefvnsvhamv54x3g4pe) + '@typespec/compiler': 0.68.0-dev.13(@types/node@22.13.17) + '@typespec/http': 0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))) + '@typespec/openapi': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)))) + '@typespec/rest': 0.68.0-dev.4(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)))) + '@typespec/versioning': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)) - '@azure-tools/typespec-azure-rulesets@0.54.0-dev.2(@azure-tools/typespec-azure-core@0.54.0-dev.5(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))(@typespec/rest@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))))(@azure-tools/typespec-azure-resource-manager@0.54.0-dev.3(vvsjt7ss6dhpuzy2lahlecfu7a))(@azure-tools/typespec-client-generator-core@0.54.0-dev.19(bi3uo6v4m3cwrf7tvdzqjmlfka))(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))': + '@azure-tools/typespec-azure-core@0.54.0-dev.5(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))))(@typespec/rest@0.68.0-dev.4(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)))))': dependencies: - '@azure-tools/typespec-azure-core': 0.54.0-dev.5(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))(@typespec/rest@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))) - '@azure-tools/typespec-azure-resource-manager': 0.54.0-dev.3(vvsjt7ss6dhpuzy2lahlecfu7a) - '@azure-tools/typespec-client-generator-core': 0.54.0-dev.19(bi3uo6v4m3cwrf7tvdzqjmlfka) - '@typespec/compiler': 0.68.0-dev.12(@types/node@22.5.5) + '@typespec/compiler': 0.68.0-dev.13(@types/node@22.13.17) + '@typespec/http': 0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))) + '@typespec/rest': 0.68.0-dev.4(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)))) - '@azure-tools/typespec-client-generator-core@0.54.0-dev.19(bi3uo6v4m3cwrf7tvdzqjmlfka)': + '@azure-tools/typespec-azure-resource-manager@0.54.0-dev.4(qb3xdiittordn2dqsr2n6il7zy)': dependencies: - '@azure-tools/typespec-azure-core': 0.54.0-dev.5(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))(@typespec/rest@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))) - '@typespec/compiler': 0.68.0-dev.12(@types/node@22.5.5) - '@typespec/events': 0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)) - '@typespec/http': 0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))) - '@typespec/openapi': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)))) - '@typespec/rest': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)))) - '@typespec/sse': 0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/events@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))) - '@typespec/streams': 0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)) - '@typespec/versioning': 0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)) - '@typespec/xml': 0.59.0(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)) + '@azure-tools/typespec-azure-core': 0.54.0-dev.5(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))))(@typespec/rest@0.68.0-dev.4(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))))) + '@typespec/compiler': 0.68.0-dev.13(@types/node@22.13.17) + '@typespec/http': 0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))) + '@typespec/openapi': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)))) + '@typespec/rest': 0.68.0-dev.4(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)))) + '@typespec/versioning': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)) change-case: 5.4.4 pluralize: 8.0.0 - yaml: 2.7.0 - '@azure-tools/typespec-client-generator-core@0.54.0-dev.19(x4iqah4tm4sou6fo55o2ec4yze)': - dependencies: - '@azure-tools/typespec-azure-core': 0.54.0-dev.5(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))))(@typespec/rest@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))))) - '@typespec/compiler': 0.68.0-dev.12(@types/node@22.13.10) - '@typespec/events': 0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10)) - '@typespec/http': 0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))) - '@typespec/openapi': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10)))) - '@typespec/rest': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10)))) - '@typespec/sse': 0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/events@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10)))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))) - '@typespec/streams': 0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10)) - '@typespec/versioning': 0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10)) - '@typespec/xml': 0.59.0(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10)) + '@azure-tools/typespec-azure-rulesets@0.54.0-dev.2(@azure-tools/typespec-azure-core@0.54.0-dev.5(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))))(@typespec/rest@0.68.0-dev.4(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))))))(@azure-tools/typespec-azure-resource-manager@0.54.0-dev.4(qb3xdiittordn2dqsr2n6il7zy))(@azure-tools/typespec-client-generator-core@0.54.0-dev.22(llvaf3qoefvnsvhamv54x3g4pe))(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))': + dependencies: + '@azure-tools/typespec-azure-core': 0.54.0-dev.5(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))))(@typespec/rest@0.68.0-dev.4(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))))) + '@azure-tools/typespec-azure-resource-manager': 0.54.0-dev.4(qb3xdiittordn2dqsr2n6il7zy) + '@azure-tools/typespec-client-generator-core': 0.54.0-dev.22(llvaf3qoefvnsvhamv54x3g4pe) + '@typespec/compiler': 0.68.0-dev.13(@types/node@22.13.17) + + '@azure-tools/typespec-client-generator-core@0.54.0-dev.22(llvaf3qoefvnsvhamv54x3g4pe)': + dependencies: + '@azure-tools/typespec-azure-core': 0.54.0-dev.5(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))))(@typespec/rest@0.68.0-dev.4(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))))) + '@typespec/compiler': 0.68.0-dev.13(@types/node@22.13.17) + '@typespec/events': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)) + '@typespec/http': 0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))) + '@typespec/openapi': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)))) + '@typespec/rest': 0.68.0-dev.4(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)))) + '@typespec/sse': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/events@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))) + '@typespec/streams': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)) + '@typespec/versioning': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)) + '@typespec/xml': 0.59.0(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)) change-case: 5.4.4 pluralize: 8.0.0 yaml: 2.7.0 @@ -5290,87 +5081,27 @@ snapshots: '@humanwhocodes/retry@0.3.0': {} - '@inquirer/checkbox@4.1.2(@types/node@22.5.5)': + '@inquirer/checkbox@4.1.4(@types/node@22.13.17)': dependencies: - '@inquirer/core': 10.1.7(@types/node@22.5.5) - '@inquirer/figures': 1.0.10 - '@inquirer/type': 3.0.4(@types/node@22.5.5) - ansi-escapes: 4.3.2 - yoctocolors-cjs: 2.1.2 - optionalDependencies: - '@types/node': 22.5.5 - - '@inquirer/checkbox@4.1.4(@types/node@22.13.10)': - dependencies: - '@inquirer/core': 10.1.9(@types/node@22.13.10) + '@inquirer/core': 10.1.9(@types/node@22.13.17) '@inquirer/figures': 1.0.11 - '@inquirer/type': 3.0.5(@types/node@22.13.10) - ansi-escapes: 4.3.2 - yoctocolors-cjs: 2.1.2 - optionalDependencies: - '@types/node': 22.13.10 - - '@inquirer/checkbox@4.1.4(@types/node@22.5.5)': - dependencies: - '@inquirer/core': 10.1.9(@types/node@22.5.5) - '@inquirer/figures': 1.0.11 - '@inquirer/type': 3.0.5(@types/node@22.5.5) - ansi-escapes: 4.3.2 - yoctocolors-cjs: 2.1.2 - optionalDependencies: - '@types/node': 22.5.5 - - '@inquirer/confirm@5.1.6(@types/node@22.5.5)': - dependencies: - '@inquirer/core': 10.1.7(@types/node@22.5.5) - '@inquirer/type': 3.0.4(@types/node@22.5.5) - optionalDependencies: - '@types/node': 22.5.5 - - '@inquirer/confirm@5.1.8(@types/node@22.13.10)': - dependencies: - '@inquirer/core': 10.1.9(@types/node@22.13.10) - '@inquirer/type': 3.0.5(@types/node@22.13.10) - optionalDependencies: - '@types/node': 22.13.10 - - '@inquirer/confirm@5.1.8(@types/node@22.5.5)': - dependencies: - '@inquirer/core': 10.1.9(@types/node@22.5.5) - '@inquirer/type': 3.0.5(@types/node@22.5.5) - optionalDependencies: - '@types/node': 22.5.5 - - '@inquirer/core@10.1.7(@types/node@22.5.5)': - dependencies: - '@inquirer/figures': 1.0.10 - '@inquirer/type': 3.0.4(@types/node@22.5.5) + '@inquirer/type': 3.0.5(@types/node@22.13.17) ansi-escapes: 4.3.2 - cli-width: 4.1.0 - mute-stream: 2.0.0 - signal-exit: 4.1.0 - wrap-ansi: 6.2.0 yoctocolors-cjs: 2.1.2 optionalDependencies: - '@types/node': 22.5.5 + '@types/node': 22.13.17 - '@inquirer/core@10.1.9(@types/node@22.13.10)': + '@inquirer/confirm@5.1.8(@types/node@22.13.17)': dependencies: - '@inquirer/figures': 1.0.11 - '@inquirer/type': 3.0.5(@types/node@22.13.10) - ansi-escapes: 4.3.2 - cli-width: 4.1.0 - mute-stream: 2.0.0 - signal-exit: 4.1.0 - wrap-ansi: 6.2.0 - yoctocolors-cjs: 2.1.2 + '@inquirer/core': 10.1.9(@types/node@22.13.17) + '@inquirer/type': 3.0.5(@types/node@22.13.17) optionalDependencies: - '@types/node': 22.13.10 + '@types/node': 22.13.17 - '@inquirer/core@10.1.9(@types/node@22.5.5)': + '@inquirer/core@10.1.9(@types/node@22.13.17)': dependencies: '@inquirer/figures': 1.0.11 - '@inquirer/type': 3.0.5(@types/node@22.5.5) + '@inquirer/type': 3.0.5(@types/node@22.13.17) ansi-escapes: 4.3.2 cli-width: 4.1.0 mute-stream: 2.0.0 @@ -5378,263 +5109,93 @@ snapshots: wrap-ansi: 6.2.0 yoctocolors-cjs: 2.1.2 optionalDependencies: - '@types/node': 22.5.5 + '@types/node': 22.13.17 - '@inquirer/editor@4.2.7(@types/node@22.5.5)': + '@inquirer/editor@4.2.9(@types/node@22.13.17)': dependencies: - '@inquirer/core': 10.1.7(@types/node@22.5.5) - '@inquirer/type': 3.0.4(@types/node@22.5.5) + '@inquirer/core': 10.1.9(@types/node@22.13.17) + '@inquirer/type': 3.0.5(@types/node@22.13.17) external-editor: 3.1.0 optionalDependencies: - '@types/node': 22.5.5 + '@types/node': 22.13.17 - '@inquirer/editor@4.2.9(@types/node@22.13.10)': + '@inquirer/expand@4.0.11(@types/node@22.13.17)': dependencies: - '@inquirer/core': 10.1.9(@types/node@22.13.10) - '@inquirer/type': 3.0.5(@types/node@22.13.10) - external-editor: 3.1.0 - optionalDependencies: - '@types/node': 22.13.10 - - '@inquirer/editor@4.2.9(@types/node@22.5.5)': - dependencies: - '@inquirer/core': 10.1.9(@types/node@22.5.5) - '@inquirer/type': 3.0.5(@types/node@22.5.5) - external-editor: 3.1.0 - optionalDependencies: - '@types/node': 22.5.5 - - '@inquirer/expand@4.0.11(@types/node@22.13.10)': - dependencies: - '@inquirer/core': 10.1.9(@types/node@22.13.10) - '@inquirer/type': 3.0.5(@types/node@22.13.10) + '@inquirer/core': 10.1.9(@types/node@22.13.17) + '@inquirer/type': 3.0.5(@types/node@22.13.17) yoctocolors-cjs: 2.1.2 optionalDependencies: - '@types/node': 22.13.10 - - '@inquirer/expand@4.0.11(@types/node@22.5.5)': - dependencies: - '@inquirer/core': 10.1.9(@types/node@22.5.5) - '@inquirer/type': 3.0.5(@types/node@22.5.5) - yoctocolors-cjs: 2.1.2 - optionalDependencies: - '@types/node': 22.5.5 - - '@inquirer/expand@4.0.9(@types/node@22.5.5)': - dependencies: - '@inquirer/core': 10.1.7(@types/node@22.5.5) - '@inquirer/type': 3.0.4(@types/node@22.5.5) - yoctocolors-cjs: 2.1.2 - optionalDependencies: - '@types/node': 22.5.5 - - '@inquirer/figures@1.0.10': {} + '@types/node': 22.13.17 '@inquirer/figures@1.0.11': {} - '@inquirer/input@4.1.6(@types/node@22.5.5)': - dependencies: - '@inquirer/core': 10.1.7(@types/node@22.5.5) - '@inquirer/type': 3.0.4(@types/node@22.5.5) - optionalDependencies: - '@types/node': 22.5.5 - - '@inquirer/input@4.1.8(@types/node@22.13.10)': - dependencies: - '@inquirer/core': 10.1.9(@types/node@22.13.10) - '@inquirer/type': 3.0.5(@types/node@22.13.10) - optionalDependencies: - '@types/node': 22.13.10 - - '@inquirer/input@4.1.8(@types/node@22.5.5)': - dependencies: - '@inquirer/core': 10.1.9(@types/node@22.5.5) - '@inquirer/type': 3.0.5(@types/node@22.5.5) - optionalDependencies: - '@types/node': 22.5.5 - - '@inquirer/number@3.0.11(@types/node@22.13.10)': - dependencies: - '@inquirer/core': 10.1.9(@types/node@22.13.10) - '@inquirer/type': 3.0.5(@types/node@22.13.10) - optionalDependencies: - '@types/node': 22.13.10 - - '@inquirer/number@3.0.11(@types/node@22.5.5)': - dependencies: - '@inquirer/core': 10.1.9(@types/node@22.5.5) - '@inquirer/type': 3.0.5(@types/node@22.5.5) - optionalDependencies: - '@types/node': 22.5.5 - - '@inquirer/number@3.0.9(@types/node@22.5.5)': - dependencies: - '@inquirer/core': 10.1.7(@types/node@22.5.5) - '@inquirer/type': 3.0.4(@types/node@22.5.5) - optionalDependencies: - '@types/node': 22.5.5 - - '@inquirer/password@4.0.11(@types/node@22.13.10)': + '@inquirer/input@4.1.8(@types/node@22.13.17)': dependencies: - '@inquirer/core': 10.1.9(@types/node@22.13.10) - '@inquirer/type': 3.0.5(@types/node@22.13.10) - ansi-escapes: 4.3.2 + '@inquirer/core': 10.1.9(@types/node@22.13.17) + '@inquirer/type': 3.0.5(@types/node@22.13.17) optionalDependencies: - '@types/node': 22.13.10 + '@types/node': 22.13.17 - '@inquirer/password@4.0.11(@types/node@22.5.5)': + '@inquirer/number@3.0.11(@types/node@22.13.17)': dependencies: - '@inquirer/core': 10.1.9(@types/node@22.5.5) - '@inquirer/type': 3.0.5(@types/node@22.5.5) - ansi-escapes: 4.3.2 + '@inquirer/core': 10.1.9(@types/node@22.13.17) + '@inquirer/type': 3.0.5(@types/node@22.13.17) optionalDependencies: - '@types/node': 22.5.5 + '@types/node': 22.13.17 - '@inquirer/password@4.0.9(@types/node@22.5.5)': + '@inquirer/password@4.0.11(@types/node@22.13.17)': dependencies: - '@inquirer/core': 10.1.7(@types/node@22.5.5) - '@inquirer/type': 3.0.4(@types/node@22.5.5) + '@inquirer/core': 10.1.9(@types/node@22.13.17) + '@inquirer/type': 3.0.5(@types/node@22.13.17) ansi-escapes: 4.3.2 optionalDependencies: - '@types/node': 22.5.5 - - '@inquirer/prompts@7.3.2(@types/node@22.5.5)': - dependencies: - '@inquirer/checkbox': 4.1.2(@types/node@22.5.5) - '@inquirer/confirm': 5.1.6(@types/node@22.5.5) - '@inquirer/editor': 4.2.7(@types/node@22.5.5) - '@inquirer/expand': 4.0.9(@types/node@22.5.5) - '@inquirer/input': 4.1.6(@types/node@22.5.5) - '@inquirer/number': 3.0.9(@types/node@22.5.5) - '@inquirer/password': 4.0.9(@types/node@22.5.5) - '@inquirer/rawlist': 4.0.9(@types/node@22.5.5) - '@inquirer/search': 3.0.9(@types/node@22.5.5) - '@inquirer/select': 4.0.9(@types/node@22.5.5) - optionalDependencies: - '@types/node': 22.5.5 - - '@inquirer/prompts@7.4.0(@types/node@22.13.10)': - dependencies: - '@inquirer/checkbox': 4.1.4(@types/node@22.13.10) - '@inquirer/confirm': 5.1.8(@types/node@22.13.10) - '@inquirer/editor': 4.2.9(@types/node@22.13.10) - '@inquirer/expand': 4.0.11(@types/node@22.13.10) - '@inquirer/input': 4.1.8(@types/node@22.13.10) - '@inquirer/number': 3.0.11(@types/node@22.13.10) - '@inquirer/password': 4.0.11(@types/node@22.13.10) - '@inquirer/rawlist': 4.0.11(@types/node@22.13.10) - '@inquirer/search': 3.0.11(@types/node@22.13.10) - '@inquirer/select': 4.1.0(@types/node@22.13.10) - optionalDependencies: - '@types/node': 22.13.10 - - '@inquirer/prompts@7.4.0(@types/node@22.5.5)': - dependencies: - '@inquirer/checkbox': 4.1.4(@types/node@22.5.5) - '@inquirer/confirm': 5.1.8(@types/node@22.5.5) - '@inquirer/editor': 4.2.9(@types/node@22.5.5) - '@inquirer/expand': 4.0.11(@types/node@22.5.5) - '@inquirer/input': 4.1.8(@types/node@22.5.5) - '@inquirer/number': 3.0.11(@types/node@22.5.5) - '@inquirer/password': 4.0.11(@types/node@22.5.5) - '@inquirer/rawlist': 4.0.11(@types/node@22.5.5) - '@inquirer/search': 3.0.11(@types/node@22.5.5) - '@inquirer/select': 4.1.0(@types/node@22.5.5) - optionalDependencies: - '@types/node': 22.5.5 - - '@inquirer/rawlist@4.0.11(@types/node@22.13.10)': - dependencies: - '@inquirer/core': 10.1.9(@types/node@22.13.10) - '@inquirer/type': 3.0.5(@types/node@22.13.10) - yoctocolors-cjs: 2.1.2 - optionalDependencies: - '@types/node': 22.13.10 - - '@inquirer/rawlist@4.0.11(@types/node@22.5.5)': - dependencies: - '@inquirer/core': 10.1.9(@types/node@22.5.5) - '@inquirer/type': 3.0.5(@types/node@22.5.5) - yoctocolors-cjs: 2.1.2 - optionalDependencies: - '@types/node': 22.5.5 - - '@inquirer/rawlist@4.0.9(@types/node@22.5.5)': - dependencies: - '@inquirer/core': 10.1.7(@types/node@22.5.5) - '@inquirer/type': 3.0.4(@types/node@22.5.5) - yoctocolors-cjs: 2.1.2 + '@types/node': 22.13.17 + + '@inquirer/prompts@7.4.0(@types/node@22.13.17)': + dependencies: + '@inquirer/checkbox': 4.1.4(@types/node@22.13.17) + '@inquirer/confirm': 5.1.8(@types/node@22.13.17) + '@inquirer/editor': 4.2.9(@types/node@22.13.17) + '@inquirer/expand': 4.0.11(@types/node@22.13.17) + '@inquirer/input': 4.1.8(@types/node@22.13.17) + '@inquirer/number': 3.0.11(@types/node@22.13.17) + '@inquirer/password': 4.0.11(@types/node@22.13.17) + '@inquirer/rawlist': 4.0.11(@types/node@22.13.17) + '@inquirer/search': 3.0.11(@types/node@22.13.17) + '@inquirer/select': 4.1.0(@types/node@22.13.17) optionalDependencies: - '@types/node': 22.5.5 + '@types/node': 22.13.17 - '@inquirer/search@3.0.11(@types/node@22.13.10)': + '@inquirer/rawlist@4.0.11(@types/node@22.13.17)': dependencies: - '@inquirer/core': 10.1.9(@types/node@22.13.10) - '@inquirer/figures': 1.0.11 - '@inquirer/type': 3.0.5(@types/node@22.13.10) + '@inquirer/core': 10.1.9(@types/node@22.13.17) + '@inquirer/type': 3.0.5(@types/node@22.13.17) yoctocolors-cjs: 2.1.2 optionalDependencies: - '@types/node': 22.13.10 + '@types/node': 22.13.17 - '@inquirer/search@3.0.11(@types/node@22.5.5)': + '@inquirer/search@3.0.11(@types/node@22.13.17)': dependencies: - '@inquirer/core': 10.1.9(@types/node@22.5.5) + '@inquirer/core': 10.1.9(@types/node@22.13.17) '@inquirer/figures': 1.0.11 - '@inquirer/type': 3.0.5(@types/node@22.5.5) - yoctocolors-cjs: 2.1.2 - optionalDependencies: - '@types/node': 22.5.5 - - '@inquirer/search@3.0.9(@types/node@22.5.5)': - dependencies: - '@inquirer/core': 10.1.7(@types/node@22.5.5) - '@inquirer/figures': 1.0.10 - '@inquirer/type': 3.0.4(@types/node@22.5.5) + '@inquirer/type': 3.0.5(@types/node@22.13.17) yoctocolors-cjs: 2.1.2 optionalDependencies: - '@types/node': 22.5.5 + '@types/node': 22.13.17 - '@inquirer/select@4.0.9(@types/node@22.5.5)': + '@inquirer/select@4.1.0(@types/node@22.13.17)': dependencies: - '@inquirer/core': 10.1.7(@types/node@22.5.5) - '@inquirer/figures': 1.0.10 - '@inquirer/type': 3.0.4(@types/node@22.5.5) - ansi-escapes: 4.3.2 - yoctocolors-cjs: 2.1.2 - optionalDependencies: - '@types/node': 22.5.5 - - '@inquirer/select@4.1.0(@types/node@22.13.10)': - dependencies: - '@inquirer/core': 10.1.9(@types/node@22.13.10) + '@inquirer/core': 10.1.9(@types/node@22.13.17) '@inquirer/figures': 1.0.11 - '@inquirer/type': 3.0.5(@types/node@22.13.10) + '@inquirer/type': 3.0.5(@types/node@22.13.17) ansi-escapes: 4.3.2 yoctocolors-cjs: 2.1.2 optionalDependencies: - '@types/node': 22.13.10 - - '@inquirer/select@4.1.0(@types/node@22.5.5)': - dependencies: - '@inquirer/core': 10.1.9(@types/node@22.5.5) - '@inquirer/figures': 1.0.11 - '@inquirer/type': 3.0.5(@types/node@22.5.5) - ansi-escapes: 4.3.2 - yoctocolors-cjs: 2.1.2 - optionalDependencies: - '@types/node': 22.5.5 - - '@inquirer/type@3.0.4(@types/node@22.5.5)': - optionalDependencies: - '@types/node': 22.5.5 - - '@inquirer/type@3.0.5(@types/node@22.13.10)': - optionalDependencies: - '@types/node': 22.13.10 + '@types/node': 22.13.17 - '@inquirer/type@3.0.5(@types/node@22.5.5)': + '@inquirer/type@3.0.5(@types/node@22.13.17)': optionalDependencies: - '@types/node': 22.5.5 + '@types/node': 22.13.17 '@isaacs/cliui@8.0.2': dependencies: @@ -6071,7 +5632,7 @@ snapshots: '@types/fs-extra@11.0.4': dependencies: '@types/jsonfile': 6.1.4 - '@types/node': 22.5.5 + '@types/node': 22.13.17 '@types/istanbul-lib-coverage@2.0.6': {} @@ -6083,16 +5644,12 @@ snapshots: '@types/jsonfile@6.1.4': dependencies: - '@types/node': 22.5.5 + '@types/node': 22.13.17 - '@types/node@22.13.10': + '@types/node@22.13.17': dependencies: undici-types: 6.20.0 - '@types/node@22.5.5': - dependencies: - undici-types: 6.19.8 - '@types/normalize-package-data@2.4.4': {} '@types/semver@7.5.8': {} @@ -6105,20 +5662,20 @@ snapshots: dependencies: '@types/yargs-parser': 21.0.3 - '@typescript-eslint/eslint-plugin@8.26.0(@typescript-eslint/parser@8.26.0(eslint@9.11.1)(typescript@5.7.3))(eslint@9.11.1)(typescript@5.7.3)': + '@typescript-eslint/eslint-plugin@8.26.0(@typescript-eslint/parser@8.26.0(eslint@9.11.1)(typescript@5.8.2))(eslint@9.11.1)(typescript@5.8.2)': dependencies: '@eslint-community/regexpp': 4.11.1 - '@typescript-eslint/parser': 8.26.0(eslint@9.11.1)(typescript@5.7.3) + '@typescript-eslint/parser': 8.26.0(eslint@9.11.1)(typescript@5.8.2) '@typescript-eslint/scope-manager': 8.26.0 - '@typescript-eslint/type-utils': 8.26.0(eslint@9.11.1)(typescript@5.7.3) - '@typescript-eslint/utils': 8.26.0(eslint@9.11.1)(typescript@5.7.3) + '@typescript-eslint/type-utils': 8.26.0(eslint@9.11.1)(typescript@5.8.2) + '@typescript-eslint/utils': 8.26.0(eslint@9.11.1)(typescript@5.8.2) '@typescript-eslint/visitor-keys': 8.26.0 eslint: 9.11.1 graphemer: 1.4.0 ignore: 5.3.2 natural-compare: 1.4.0 - ts-api-utils: 2.0.1(typescript@5.7.3) - typescript: 5.7.3 + ts-api-utils: 2.0.1(typescript@5.8.2) + typescript: 5.8.2 transitivePeerDependencies: - supports-color @@ -6140,15 +5697,15 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/parser@8.26.0(eslint@9.11.1)(typescript@5.7.3)': + '@typescript-eslint/parser@8.26.0(eslint@9.11.1)(typescript@5.8.2)': dependencies: '@typescript-eslint/scope-manager': 8.26.0 '@typescript-eslint/types': 8.26.0 - '@typescript-eslint/typescript-estree': 8.26.0(typescript@5.7.3) + '@typescript-eslint/typescript-estree': 8.26.0(typescript@5.8.2) '@typescript-eslint/visitor-keys': 8.26.0 debug: 4.3.7 eslint: 9.11.1 - typescript: 5.7.3 + typescript: 5.8.2 transitivePeerDependencies: - supports-color @@ -6175,14 +5732,14 @@ snapshots: '@typescript-eslint/types': 8.7.0 '@typescript-eslint/visitor-keys': 8.7.0 - '@typescript-eslint/type-utils@8.26.0(eslint@9.11.1)(typescript@5.7.3)': + '@typescript-eslint/type-utils@8.26.0(eslint@9.11.1)(typescript@5.8.2)': dependencies: - '@typescript-eslint/typescript-estree': 8.26.0(typescript@5.7.3) - '@typescript-eslint/utils': 8.26.0(eslint@9.11.1)(typescript@5.7.3) + '@typescript-eslint/typescript-estree': 8.26.0(typescript@5.8.2) + '@typescript-eslint/utils': 8.26.0(eslint@9.11.1)(typescript@5.8.2) debug: 4.4.0 eslint: 9.11.1 - ts-api-utils: 2.0.1(typescript@5.7.3) - typescript: 5.7.3 + ts-api-utils: 2.0.1(typescript@5.8.2) + typescript: 5.8.2 transitivePeerDependencies: - supports-color @@ -6202,7 +5759,7 @@ snapshots: '@typescript-eslint/types@8.7.0': {} - '@typescript-eslint/typescript-estree@8.26.0(typescript@5.7.3)': + '@typescript-eslint/typescript-estree@8.26.0(typescript@5.8.2)': dependencies: '@typescript-eslint/types': 8.26.0 '@typescript-eslint/visitor-keys': 8.26.0 @@ -6211,8 +5768,8 @@ snapshots: is-glob: 4.0.3 minimatch: 9.0.5 semver: 7.6.3 - ts-api-utils: 2.0.1(typescript@5.7.3) - typescript: 5.7.3 + ts-api-utils: 2.0.1(typescript@5.8.2) + typescript: 5.8.2 transitivePeerDependencies: - supports-color @@ -6231,14 +5788,14 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/utils@8.26.0(eslint@9.11.1)(typescript@5.7.3)': + '@typescript-eslint/utils@8.26.0(eslint@9.11.1)(typescript@5.8.2)': dependencies: '@eslint-community/eslint-utils': 4.4.0(eslint@9.11.1) '@typescript-eslint/scope-manager': 8.26.0 '@typescript-eslint/types': 8.26.0 - '@typescript-eslint/typescript-estree': 8.26.0(typescript@5.7.3) + '@typescript-eslint/typescript-estree': 8.26.0(typescript@5.8.2) eslint: 9.11.1 - typescript: 5.7.3 + typescript: 5.8.2 transitivePeerDependencies: - supports-color @@ -6263,54 +5820,10 @@ snapshots: '@typescript-eslint/types': 8.7.0 eslint-visitor-keys: 3.4.3 - '@typespec/compiler@0.67.2(@types/node@22.5.5)': - dependencies: - '@babel/code-frame': 7.26.2 - '@inquirer/prompts': 7.3.2(@types/node@22.5.5) - ajv: 8.17.1 - change-case: 5.4.4 - env-paths: 3.0.0 - globby: 14.1.0 - is-unicode-supported: 2.1.0 - mustache: 4.2.0 - picocolors: 1.1.1 - prettier: 3.5.3 - semver: 7.7.1 - tar: 7.4.3 - temporal-polyfill: 0.2.5 - vscode-languageserver: 9.0.1 - vscode-languageserver-textdocument: 1.0.12 - yaml: 2.7.0 - yargs: 17.7.2 - transitivePeerDependencies: - - '@types/node' - - '@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10)': - dependencies: - '@babel/code-frame': 7.26.2 - '@inquirer/prompts': 7.4.0(@types/node@22.13.10) - ajv: 8.17.1 - change-case: 5.4.4 - env-paths: 3.0.0 - globby: 14.1.0 - is-unicode-supported: 2.1.0 - mustache: 4.2.0 - picocolors: 1.1.1 - prettier: 3.5.3 - semver: 7.7.1 - tar: 7.4.3 - temporal-polyfill: 0.2.5 - vscode-languageserver: 9.0.1 - vscode-languageserver-textdocument: 1.0.12 - yaml: 2.7.0 - yargs: 17.7.2 - transitivePeerDependencies: - - '@types/node' - - '@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)': + '@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)': dependencies: '@babel/code-frame': 7.26.2 - '@inquirer/prompts': 7.4.0(@types/node@22.5.5) + '@inquirer/prompts': 7.4.0(@types/node@22.13.17) ajv: 8.17.1 change-case: 5.4.4 env-paths: 3.0.0 @@ -6329,53 +5842,25 @@ snapshots: transitivePeerDependencies: - '@types/node' - '@typespec/events@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))': - dependencies: - '@typespec/compiler': 0.68.0-dev.12(@types/node@22.13.10) - - '@typespec/events@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))': - dependencies: - '@typespec/compiler': 0.68.0-dev.12(@types/node@22.5.5) - - '@typespec/http-client-python@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcwOTg1Ny9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.2.tgz(vc45nnffght74sl4sibvll3pxy)': - dependencies: - '@azure-tools/typespec-autorest': 0.54.0-dev.5(sc7idhpgkzao6ca27f5n4spwdm) - '@azure-tools/typespec-azure-core': 0.54.0-dev.5(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))))(@typespec/rest@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))))) - '@azure-tools/typespec-azure-resource-manager': 0.54.0-dev.3(v3vj4toze5ay2f53uheih2fore) - '@azure-tools/typespec-azure-rulesets': 0.54.0-dev.2(@azure-tools/typespec-azure-core@0.54.0-dev.5(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))))(@typespec/rest@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))))))(@azure-tools/typespec-azure-resource-manager@0.54.0-dev.3(v3vj4toze5ay2f53uheih2fore))(@azure-tools/typespec-client-generator-core@0.54.0-dev.19(x4iqah4tm4sou6fo55o2ec4yze))(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10)) - '@azure-tools/typespec-client-generator-core': 0.54.0-dev.19(x4iqah4tm4sou6fo55o2ec4yze) - '@typespec/compiler': 0.68.0-dev.12(@types/node@22.13.10) - '@typespec/events': 0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10)) - '@typespec/http': 0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))) - '@typespec/openapi': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10)))) - '@typespec/rest': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10)))) - '@typespec/sse': 0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/events@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10)))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))) - '@typespec/streams': 0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10)) - '@typespec/versioning': 0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10)) - js-yaml: 4.1.0 - marked: 15.0.7 - pyodide: 0.26.2 - semver: 7.6.3 - tsx: 4.19.3 - transitivePeerDependencies: - - bufferutil - - utf-8-validate - - '@typespec/http-client-python@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcwOTg1Ny9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.2.tgz(vqafh2xgemu2dyfvlgvmut4cti)': - dependencies: - '@azure-tools/typespec-autorest': 0.54.0-dev.5(terlvcbdqtyv3m5pmsko2l6fny) - '@azure-tools/typespec-azure-core': 0.54.0-dev.5(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))(@typespec/rest@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))) - '@azure-tools/typespec-azure-resource-manager': 0.54.0-dev.3(vvsjt7ss6dhpuzy2lahlecfu7a) - '@azure-tools/typespec-azure-rulesets': 0.54.0-dev.2(@azure-tools/typespec-azure-core@0.54.0-dev.5(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))(@typespec/rest@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))))(@azure-tools/typespec-azure-resource-manager@0.54.0-dev.3(vvsjt7ss6dhpuzy2lahlecfu7a))(@azure-tools/typespec-client-generator-core@0.54.0-dev.19(bi3uo6v4m3cwrf7tvdzqjmlfka))(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)) - '@azure-tools/typespec-client-generator-core': 0.54.0-dev.19(bi3uo6v4m3cwrf7tvdzqjmlfka) - '@typespec/compiler': 0.68.0-dev.12(@types/node@22.5.5) - '@typespec/events': 0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)) - '@typespec/http': 0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))) - '@typespec/openapi': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)))) - '@typespec/rest': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)))) - '@typespec/sse': 0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/events@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))) - '@typespec/streams': 0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)) - '@typespec/versioning': 0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)) + '@typespec/events@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))': + dependencies: + '@typespec/compiler': 0.68.0-dev.13(@types/node@22.13.17) + + '@typespec/http-client-python@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcxNDA2NS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.2.tgz(7lctz6vgqeif7iqlya3bzwoexa)': + dependencies: + '@azure-tools/typespec-autorest': 0.54.0-dev.5(slqx2jlvr2rb5u5z3itjv7na4u) + '@azure-tools/typespec-azure-core': 0.54.0-dev.5(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))))(@typespec/rest@0.68.0-dev.4(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))))) + '@azure-tools/typespec-azure-resource-manager': 0.54.0-dev.4(qb3xdiittordn2dqsr2n6il7zy) + '@azure-tools/typespec-azure-rulesets': 0.54.0-dev.2(@azure-tools/typespec-azure-core@0.54.0-dev.5(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))))(@typespec/rest@0.68.0-dev.4(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))))))(@azure-tools/typespec-azure-resource-manager@0.54.0-dev.4(qb3xdiittordn2dqsr2n6il7zy))(@azure-tools/typespec-client-generator-core@0.54.0-dev.22(llvaf3qoefvnsvhamv54x3g4pe))(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)) + '@azure-tools/typespec-client-generator-core': 0.54.0-dev.22(llvaf3qoefvnsvhamv54x3g4pe) + '@typespec/compiler': 0.68.0-dev.13(@types/node@22.13.17) + '@typespec/events': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)) + '@typespec/http': 0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))) + '@typespec/openapi': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)))) + '@typespec/rest': 0.68.0-dev.4(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)))) + '@typespec/sse': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/events@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))) + '@typespec/streams': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)) + '@typespec/versioning': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)) js-yaml: 4.1.0 marked: 15.0.7 pyodide: 0.26.2 @@ -6385,100 +5870,63 @@ snapshots: - bufferutil - utf-8-validate - '@typespec/http-specs@0.1.0-alpha.17-dev.1(@types/node@22.5.5)(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))(@typespec/rest@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)))))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)))(@typespec/versioning@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)))(@typespec/xml@0.59.0(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)))': + '@typespec/http-specs@0.1.0-alpha.17-dev.2(@types/node@22.13.17)(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))))(@typespec/rest@0.68.0-dev.4(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)))))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)))(@typespec/versioning@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)))(@typespec/xml@0.59.0(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)))': dependencies: - '@typespec/compiler': 0.68.0-dev.12(@types/node@22.5.5) - '@typespec/http': 0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))) - '@typespec/rest': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)))) - '@typespec/spec-api': 0.1.0-alpha.3-dev.0 - '@typespec/spector': 0.1.0-alpha.10(@types/node@22.5.5)(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))) - '@typespec/versioning': 0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)) - '@typespec/xml': 0.59.0(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)) + '@typespec/compiler': 0.68.0-dev.13(@types/node@22.13.17) + '@typespec/http': 0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))) + '@typespec/rest': 0.68.0-dev.4(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)))) + '@typespec/spec-api': 0.1.0-alpha.4-dev.0 + '@typespec/spector': 0.1.0-alpha.11-dev.2(@types/node@22.13.17)(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))) + '@typespec/versioning': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)) + '@typespec/xml': 0.59.0(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)) deep-equal: 2.2.3 transitivePeerDependencies: - - '@types/express' - '@types/node' - '@typespec/streams' - supports-color - '@typespec/http@0.67.1(@typespec/compiler@0.67.2(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)))': + '@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)))': dependencies: - '@typespec/compiler': 0.67.2(@types/node@22.5.5) + '@typespec/compiler': 0.68.0-dev.13(@types/node@22.13.17) optionalDependencies: - '@typespec/streams': 0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)) - - '@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10)))': - dependencies: - '@typespec/compiler': 0.68.0-dev.12(@types/node@22.13.10) - optionalDependencies: - '@typespec/streams': 0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10)) - - '@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)))': - dependencies: - '@typespec/compiler': 0.68.0-dev.12(@types/node@22.5.5) - optionalDependencies: - '@typespec/streams': 0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)) - - '@typespec/openapi@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))))': - dependencies: - '@typespec/compiler': 0.68.0-dev.12(@types/node@22.13.10) - '@typespec/http': 0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))) - - '@typespec/openapi@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))': - dependencies: - '@typespec/compiler': 0.68.0-dev.12(@types/node@22.5.5) - '@typespec/http': 0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))) - - '@typespec/rest@0.67.1(@typespec/compiler@0.67.2(@types/node@22.5.5))(@typespec/http@0.67.1(@typespec/compiler@0.67.2(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))': - dependencies: - '@typespec/compiler': 0.67.2(@types/node@22.5.5) - '@typespec/http': 0.67.1(@typespec/compiler@0.67.2(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))) + '@typespec/streams': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)) - '@typespec/rest@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))))': + '@typespec/openapi@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))))': dependencies: - '@typespec/compiler': 0.68.0-dev.12(@types/node@22.13.10) - '@typespec/http': 0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))) + '@typespec/compiler': 0.68.0-dev.13(@types/node@22.13.17) + '@typespec/http': 0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))) - '@typespec/rest@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))': + '@typespec/rest@0.68.0-dev.4(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))))': dependencies: - '@typespec/compiler': 0.68.0-dev.12(@types/node@22.5.5) - '@typespec/http': 0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))) + '@typespec/compiler': 0.68.0-dev.13(@types/node@22.13.17) + '@typespec/http': 0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))) - '@typespec/spec-api@0.1.0-alpha.3-dev.0': + '@typespec/spec-api@0.1.0-alpha.4-dev.0': dependencies: - body-parser: 1.20.3 deep-equal: 2.2.3 express: 4.21.2 - express-promise-router: 4.1.1(express@4.21.2) - morgan: 1.10.0 - multer: 1.4.5-lts.1 - picocolors: 1.1.1 - prettier: 3.5.3 - winston: 3.17.0 xml2js: 0.6.2 - yargs: 17.7.2 transitivePeerDependencies: - - '@types/express' - supports-color '@typespec/spec-coverage-sdk@0.1.0-alpha.5-dev.0': dependencies: '@azure/identity': 4.7.0 '@azure/storage-blob': 12.26.0 - '@types/node': 22.13.10 + '@types/node': 22.13.17 transitivePeerDependencies: - supports-color - '@typespec/spector@0.1.0-alpha.10(@types/node@22.5.5)(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)))': + '@typespec/spector@0.1.0-alpha.11-dev.2(@types/node@22.13.17)(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)))': dependencies: '@azure/identity': 4.8.0 '@types/js-yaml': 4.0.9 - '@typespec/compiler': 0.67.2(@types/node@22.5.5) - '@typespec/http': 0.67.1(@typespec/compiler@0.67.2(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))) - '@typespec/rest': 0.67.1(@typespec/compiler@0.67.2(@types/node@22.5.5))(@typespec/http@0.67.1(@typespec/compiler@0.67.2(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)))) - '@typespec/spec-api': 0.1.0-alpha.3-dev.0 + '@typespec/compiler': 0.68.0-dev.13(@types/node@22.13.17) + '@typespec/http': 0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))) + '@typespec/rest': 0.68.0-dev.4(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)))) + '@typespec/spec-api': 0.1.0-alpha.4-dev.0 '@typespec/spec-coverage-sdk': 0.1.0-alpha.5-dev.0 - '@typespec/versioning': 0.67.1(@typespec/compiler@0.67.2(@types/node@22.5.5)) + '@typespec/versioning': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)) ajv: 8.17.1 body-parser: 1.20.3 deep-equal: 2.2.3 @@ -6493,52 +5941,28 @@ snapshots: xml2js: 0.6.2 yargs: 17.7.2 transitivePeerDependencies: - - '@types/express' - '@types/node' - '@typespec/streams' - supports-color - '@typespec/sse@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/events@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10)))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10)))': - dependencies: - '@typespec/compiler': 0.68.0-dev.12(@types/node@22.13.10) - '@typespec/events': 0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10)) - '@typespec/http': 0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))) - '@typespec/streams': 0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10)) - - '@typespec/sse@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/events@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)))(@typespec/http@0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)))': + '@typespec/sse@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/events@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)))': dependencies: - '@typespec/compiler': 0.68.0-dev.12(@types/node@22.5.5) - '@typespec/events': 0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)) - '@typespec/http': 0.68.0-dev.8(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))(@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))) - '@typespec/streams': 0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5)) + '@typespec/compiler': 0.68.0-dev.13(@types/node@22.13.17) + '@typespec/events': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)) + '@typespec/http': 0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))) + '@typespec/streams': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)) - '@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))': + '@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))': dependencies: - '@typespec/compiler': 0.68.0-dev.12(@types/node@22.13.10) + '@typespec/compiler': 0.68.0-dev.13(@types/node@22.13.17) - '@typespec/streams@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))': + '@typespec/versioning@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))': dependencies: - '@typespec/compiler': 0.68.0-dev.12(@types/node@22.5.5) + '@typespec/compiler': 0.68.0-dev.13(@types/node@22.13.17) - '@typespec/versioning@0.67.1(@typespec/compiler@0.67.2(@types/node@22.5.5))': + '@typespec/xml@0.59.0(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))': dependencies: - '@typespec/compiler': 0.67.2(@types/node@22.5.5) - - '@typespec/versioning@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))': - dependencies: - '@typespec/compiler': 0.68.0-dev.12(@types/node@22.13.10) - - '@typespec/versioning@0.68.0-dev.2(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))': - dependencies: - '@typespec/compiler': 0.68.0-dev.12(@types/node@22.5.5) - - '@typespec/xml@0.59.0(@typespec/compiler@0.68.0-dev.12(@types/node@22.13.10))': - dependencies: - '@typespec/compiler': 0.68.0-dev.12(@types/node@22.13.10) - - '@typespec/xml@0.59.0(@typespec/compiler@0.68.0-dev.12(@types/node@22.5.5))': - dependencies: - '@typespec/compiler': 0.68.0-dev.12(@types/node@22.5.5) + '@typespec/compiler': 0.68.0-dev.13(@types/node@22.13.17) '@vitest/expect@3.0.8': dependencies: @@ -6547,13 +5971,13 @@ snapshots: chai: 5.2.0 tinyrainbow: 2.0.0 - '@vitest/mocker@3.0.8(vite@5.4.8(@types/node@22.5.5))': + '@vitest/mocker@3.0.8(vite@5.4.8(@types/node@22.13.17))': dependencies: '@vitest/spy': 3.0.8 estree-walker: 3.0.3 magic-string: 0.30.17 optionalDependencies: - vite: 5.4.8(@types/node@22.5.5) + vite: 5.4.8(@types/node@22.13.17) '@vitest/pretty-format@3.0.8': dependencies: @@ -7523,13 +6947,6 @@ snapshots: lodash.flattendeep: 4.4.0 methods: 1.1.2 - express-promise-router@4.1.1(express@4.21.2): - dependencies: - express: 4.21.2 - is-promise: 4.0.0 - lodash.flattendeep: 4.4.0 - methods: 1.1.2 - express@4.21.0: dependencies: accepts: 1.3.8 @@ -8405,16 +7822,6 @@ snapshots: ms@2.1.3: {} - multer@1.4.5-lts.1: - dependencies: - append-field: 1.0.0 - busboy: 1.6.0 - concat-stream: 1.6.2 - mkdirp: 0.5.6 - object-assign: 4.1.1 - type-is: 1.6.18 - xtend: 4.0.2 - multer@1.4.5-lts.2: dependencies: append-field: 1.0.0 @@ -9246,9 +8653,9 @@ snapshots: dependencies: typescript: 5.6.2 - ts-api-utils@2.0.1(typescript@5.7.3): + ts-api-utils@2.0.1(typescript@5.8.2): dependencies: - typescript: 5.7.3 + typescript: 5.8.2 ts-toolbelt@9.6.0: {} @@ -9333,13 +8740,13 @@ snapshots: typedarray@0.0.6: {} - typescript-eslint@8.26.0(eslint@9.11.1)(typescript@5.7.3): + typescript-eslint@8.26.0(eslint@9.11.1)(typescript@5.8.2): dependencies: - '@typescript-eslint/eslint-plugin': 8.26.0(@typescript-eslint/parser@8.26.0(eslint@9.11.1)(typescript@5.7.3))(eslint@9.11.1)(typescript@5.7.3) - '@typescript-eslint/parser': 8.26.0(eslint@9.11.1)(typescript@5.7.3) - '@typescript-eslint/utils': 8.26.0(eslint@9.11.1)(typescript@5.7.3) + '@typescript-eslint/eslint-plugin': 8.26.0(@typescript-eslint/parser@8.26.0(eslint@9.11.1)(typescript@5.8.2))(eslint@9.11.1)(typescript@5.8.2) + '@typescript-eslint/parser': 8.26.0(eslint@9.11.1)(typescript@5.8.2) + '@typescript-eslint/utils': 8.26.0(eslint@9.11.1)(typescript@5.8.2) eslint: 9.11.1 - typescript: 5.7.3 + typescript: 5.8.2 transitivePeerDependencies: - supports-color @@ -9358,7 +8765,7 @@ snapshots: typescript@5.6.2: {} - typescript@5.7.3: {} + typescript@5.8.2: {} unbox-primitive@1.0.2: dependencies: @@ -9369,8 +8776,6 @@ snapshots: underscore@1.13.7: {} - undici-types@6.19.8: {} - undici-types@6.20.0: {} undici@5.28.4: @@ -9434,13 +8839,13 @@ snapshots: vary@1.1.2: {} - vite-node@3.0.8(@types/node@22.5.5): + vite-node@3.0.8(@types/node@22.13.17): dependencies: cac: 6.7.14 debug: 4.4.0 es-module-lexer: 1.6.0 pathe: 2.0.3 - vite: 5.4.8(@types/node@22.5.5) + vite: 5.4.8(@types/node@22.13.17) transitivePeerDependencies: - '@types/node' - less @@ -9452,19 +8857,19 @@ snapshots: - supports-color - terser - vite@5.4.8(@types/node@22.5.5): + vite@5.4.8(@types/node@22.13.17): dependencies: esbuild: 0.21.5 postcss: 8.4.47 rollup: 4.22.4 optionalDependencies: - '@types/node': 22.5.5 + '@types/node': 22.13.17 fsevents: 2.3.3 - vitest@3.0.8(@types/node@22.5.5): + vitest@3.0.8(@types/node@22.13.17): dependencies: '@vitest/expect': 3.0.8 - '@vitest/mocker': 3.0.8(vite@5.4.8(@types/node@22.5.5)) + '@vitest/mocker': 3.0.8(vite@5.4.8(@types/node@22.13.17)) '@vitest/pretty-format': 3.0.8 '@vitest/runner': 3.0.8 '@vitest/snapshot': 3.0.8 @@ -9480,11 +8885,11 @@ snapshots: tinyexec: 0.3.2 tinypool: 1.0.2 tinyrainbow: 2.0.0 - vite: 5.4.8(@types/node@22.5.5) - vite-node: 3.0.8(@types/node@22.5.5) + vite: 5.4.8(@types/node@22.13.17) + vite-node: 3.0.8(@types/node@22.13.17) why-is-node-running: 2.3.0 optionalDependencies: - '@types/node': 22.5.5 + '@types/node': 22.13.17 transitivePeerDependencies: - less - lightningcss @@ -9576,20 +8981,6 @@ snapshots: triple-beam: 1.4.1 winston-transport: 4.9.0 - winston@3.17.0: - dependencies: - '@colors/colors': 1.6.0 - '@dabh/diagnostics': 2.0.3 - async: 3.2.6 - is-stream: 2.0.1 - logform: 2.7.0 - one-time: 1.0.0 - readable-stream: 3.6.2 - safe-stable-stringify: 2.5.0 - stack-trace: 0.0.10 - triple-beam: 1.4.1 - winston-transport: 4.9.0 - word-wrap@1.2.5: {} wrap-ansi@6.2.0: From 4c0b1c70096810d479b34a14f18cf13492f2bf63 Mon Sep 17 00:00:00 2001 From: AutoPrFromHttpClientPython Date: Wed, 2 Apr 2025 10:29:42 +0000 Subject: [PATCH 12/19] Regenerate for typespec-python (2025-04-02 10:29:42) --- .../union/aio/operations/_operations.py | 100 ++++++++-------- .../typetest/union/models/_models.py | 108 +++++++++--------- .../typetest/union/operations/_operations.py | 100 ++++++++-------- 3 files changed, 154 insertions(+), 154 deletions(-) diff --git a/packages/typespec-python/test/azure/generated/typetest-union/typetest/union/aio/operations/_operations.py b/packages/typespec-python/test/azure/generated/typetest-union/typetest/union/aio/operations/_operations.py index fdda55b7078..e2cc25140e8 100644 --- a/packages/typespec-python/test/azure/generated/typetest-union/typetest/union/aio/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-union/typetest/union/aio/operations/_operations.py @@ -76,11 +76,11 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async - async def get(self, **kwargs: Any) -> _models.GetResponse9: + async def get(self, **kwargs: Any) -> _models.GetResponse: """get. - :return: GetResponse9. The GetResponse9 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse9 + :return: GetResponse. The GetResponse is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -94,7 +94,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse9: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse9] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse] = kwargs.pop("cls", None) _request = build_strings_only_get_request( headers=_headers, @@ -124,7 +124,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse9: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse9, response.json()) + deserialized = _deserialize(_models.GetResponse, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -261,11 +261,11 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async - async def get(self, **kwargs: Any) -> _models.GetResponse8: + async def get(self, **kwargs: Any) -> _models.GetResponse1: """get. - :return: GetResponse8. The GetResponse8 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse8 + :return: GetResponse1. The GetResponse1 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse1 :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -279,7 +279,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse8: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse8] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse1] = kwargs.pop("cls", None) _request = build_string_extensible_get_request( headers=_headers, @@ -309,7 +309,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse8: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse8, response.json()) + deserialized = _deserialize(_models.GetResponse1, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -448,11 +448,11 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async - async def get(self, **kwargs: Any) -> _models.GetResponse7: + async def get(self, **kwargs: Any) -> _models.GetResponse2: """get. - :return: GetResponse7. The GetResponse7 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse7 + :return: GetResponse2. The GetResponse2 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse2 :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -466,7 +466,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse7: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse7] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse2] = kwargs.pop("cls", None) _request = build_string_extensible_named_get_request( headers=_headers, @@ -496,7 +496,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse7: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse7, response.json()) + deserialized = _deserialize(_models.GetResponse2, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -639,11 +639,11 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async - async def get(self, **kwargs: Any) -> _models.GetResponse6: + async def get(self, **kwargs: Any) -> _models.GetResponse3: """get. - :return: GetResponse6. The GetResponse6 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse6 + :return: GetResponse3. The GetResponse3 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse3 :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -657,7 +657,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse6: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse6] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse3] = kwargs.pop("cls", None) _request = build_ints_only_get_request( headers=_headers, @@ -687,7 +687,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse6: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse6, response.json()) + deserialized = _deserialize(_models.GetResponse3, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -820,11 +820,11 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async - async def get(self, **kwargs: Any) -> _models.GetResponse5: + async def get(self, **kwargs: Any) -> _models.GetResponse4: """get. - :return: GetResponse5. The GetResponse5 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse5 + :return: GetResponse4. The GetResponse4 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse4 :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -838,7 +838,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse5: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse5] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse4] = kwargs.pop("cls", None) _request = build_floats_only_get_request( headers=_headers, @@ -868,7 +868,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse5: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse5, response.json()) + deserialized = _deserialize(_models.GetResponse4, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -999,11 +999,11 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async - async def get(self, **kwargs: Any) -> _models.GetResponse4: + async def get(self, **kwargs: Any) -> _models.GetResponse5: """get. - :return: GetResponse4. The GetResponse4 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse4 + :return: GetResponse5. The GetResponse5 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse5 :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1017,7 +1017,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse4: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse4] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse5] = kwargs.pop("cls", None) _request = build_models_only_get_request( headers=_headers, @@ -1047,7 +1047,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse4: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse4, response.json()) + deserialized = _deserialize(_models.GetResponse5, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1182,11 +1182,11 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async - async def get(self, **kwargs: Any) -> _models.GetResponse3: + async def get(self, **kwargs: Any) -> _models.GetResponse6: """get. - :return: GetResponse3. The GetResponse3 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse3 + :return: GetResponse6. The GetResponse6 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse6 :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1200,7 +1200,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse3: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse3] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse6] = kwargs.pop("cls", None) _request = build_enums_only_get_request( headers=_headers, @@ -1230,7 +1230,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse3: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse3, response.json()) + deserialized = _deserialize(_models.GetResponse6, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1365,11 +1365,11 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async - async def get(self, **kwargs: Any) -> _models.GetResponse2: + async def get(self, **kwargs: Any) -> _models.GetResponse7: """get. - :return: GetResponse2. The GetResponse2 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse2 + :return: GetResponse7. The GetResponse7 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse7 :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1383,7 +1383,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse2: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse2] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse7] = kwargs.pop("cls", None) _request = build_string_and_array_get_request( headers=_headers, @@ -1413,7 +1413,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse2: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse2, response.json()) + deserialized = _deserialize(_models.GetResponse7, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1548,11 +1548,11 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async - async def get(self, **kwargs: Any) -> _models.GetResponse1: + async def get(self, **kwargs: Any) -> _models.GetResponse8: """get. - :return: GetResponse1. The GetResponse1 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse1 + :return: GetResponse8. The GetResponse8 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse8 :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1566,7 +1566,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse1: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse1] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse8] = kwargs.pop("cls", None) _request = build_mixed_literals_get_request( headers=_headers, @@ -1596,7 +1596,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse1: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse1, response.json()) + deserialized = _deserialize(_models.GetResponse8, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1731,11 +1731,11 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace_async - async def get(self, **kwargs: Any) -> _models.GetResponse: + async def get(self, **kwargs: Any) -> _models.GetResponse9: """get. - :return: GetResponse. The GetResponse is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse + :return: GetResponse9. The GetResponse9 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse9 :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1749,7 +1749,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse9] = kwargs.pop("cls", None) _request = build_mixed_types_get_request( headers=_headers, @@ -1779,7 +1779,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse, response.json()) + deserialized = _deserialize(_models.GetResponse9, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/typetest-union/typetest/union/models/_models.py b/packages/typespec-python/test/azure/generated/typetest-union/typetest/union/models/_models.py index bdb8c270df3..8a5b2e4ac34 100644 --- a/packages/typespec-python/test/azure/generated/typetest-union/typetest/union/models/_models.py +++ b/packages/typespec-python/test/azure/generated/typetest-union/typetest/union/models/_models.py @@ -106,18 +106,18 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class GetResponse(_model_base.Model): """GetResponse. - :ivar prop: Required. - :vartype prop: ~typetest.union.models.MixedTypesCases + :ivar prop: Required. Is one of the following types: Literal["a"], Literal["b"], Literal["c"] + :vartype prop: str or str or str """ - prop: "_models.MixedTypesCases" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" + prop: Literal["a", "b", "c"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Is one of the following types: Literal[\"a\"], Literal[\"b\"], Literal[\"c\"]""" @overload def __init__( self, *, - prop: "_models.MixedTypesCases", + prop: Literal["a", "b", "c"], ) -> None: ... @overload @@ -134,18 +134,20 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class GetResponse1(_model_base.Model): """GetResponse1. - :ivar prop: Required. - :vartype prop: ~typetest.union.models.MixedLiteralsCases + :ivar prop: Required. Is one of the following types: Literal["b"], Literal["c"], str + :vartype prop: str or str or str """ - prop: "_models.MixedLiteralsCases" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" + prop: Union[Literal["b"], Literal["c"], str] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Required. Is one of the following types: Literal[\"b\"], Literal[\"c\"], str""" @overload def __init__( self, *, - prop: "_models.MixedLiteralsCases", + prop: Union[Literal["b"], Literal["c"], str], ) -> None: ... @overload @@ -162,18 +164,20 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class GetResponse2(_model_base.Model): """GetResponse2. - :ivar prop: Required. - :vartype prop: ~typetest.union.models.StringAndArrayCases + :ivar prop: Required. Known values are: "b" and "c". + :vartype prop: str or ~typetest.union.models.StringExtensibleNamedUnion """ - prop: "_models.StringAndArrayCases" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" + prop: Union[str, "_models.StringExtensibleNamedUnion"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Required. Known values are: \"b\" and \"c\".""" @overload def __init__( self, *, - prop: "_models.StringAndArrayCases", + prop: Union[str, "_models.StringExtensibleNamedUnion"], ) -> None: ... @overload @@ -190,18 +194,18 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class GetResponse3(_model_base.Model): """GetResponse3. - :ivar prop: Required. - :vartype prop: ~typetest.union.models.EnumsOnlyCases + :ivar prop: Required. Is one of the following types: Literal[1], Literal[2], Literal[3] + :vartype prop: int or int or int """ - prop: "_models.EnumsOnlyCases" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" + prop: Literal[1, 2, 3] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Is one of the following types: Literal[1], Literal[2], Literal[3]""" @overload def __init__( self, *, - prop: "_models.EnumsOnlyCases", + prop: Literal[1, 2, 3], ) -> None: ... @overload @@ -218,18 +222,18 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class GetResponse4(_model_base.Model): """GetResponse4. - :ivar prop: Required. Is either a Cat type or a Dog type. - :vartype prop: ~typetest.union.models.Cat or ~typetest.union.models.Dog + :ivar prop: Required. Is one of the following types: float + :vartype prop: float or float or float """ - prop: Union["_models.Cat", "_models.Dog"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required. Is either a Cat type or a Dog type.""" + prop: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Is one of the following types: float""" @overload def __init__( self, *, - prop: Union["_models.Cat", "_models.Dog"], + prop: float, ) -> None: ... @overload @@ -246,18 +250,18 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class GetResponse5(_model_base.Model): """GetResponse5. - :ivar prop: Required. Is one of the following types: float - :vartype prop: float or float or float + :ivar prop: Required. Is either a Cat type or a Dog type. + :vartype prop: ~typetest.union.models.Cat or ~typetest.union.models.Dog """ - prop: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required. Is one of the following types: float""" + prop: Union["_models.Cat", "_models.Dog"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Is either a Cat type or a Dog type.""" @overload def __init__( self, *, - prop: float, + prop: Union["_models.Cat", "_models.Dog"], ) -> None: ... @overload @@ -274,18 +278,18 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class GetResponse6(_model_base.Model): """GetResponse6. - :ivar prop: Required. Is one of the following types: Literal[1], Literal[2], Literal[3] - :vartype prop: int or int or int + :ivar prop: Required. + :vartype prop: ~typetest.union.models.EnumsOnlyCases """ - prop: Literal[1, 2, 3] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required. Is one of the following types: Literal[1], Literal[2], Literal[3]""" + prop: "_models.EnumsOnlyCases" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" @overload def __init__( self, *, - prop: Literal[1, 2, 3], + prop: "_models.EnumsOnlyCases", ) -> None: ... @overload @@ -302,20 +306,18 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class GetResponse7(_model_base.Model): """GetResponse7. - :ivar prop: Required. Known values are: "b" and "c". - :vartype prop: str or ~typetest.union.models.StringExtensibleNamedUnion + :ivar prop: Required. + :vartype prop: ~typetest.union.models.StringAndArrayCases """ - prop: Union[str, "_models.StringExtensibleNamedUnion"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Required. Known values are: \"b\" and \"c\".""" + prop: "_models.StringAndArrayCases" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" @overload def __init__( self, *, - prop: Union[str, "_models.StringExtensibleNamedUnion"], + prop: "_models.StringAndArrayCases", ) -> None: ... @overload @@ -332,20 +334,18 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class GetResponse8(_model_base.Model): """GetResponse8. - :ivar prop: Required. Is one of the following types: Literal["b"], Literal["c"], str - :vartype prop: str or str or str + :ivar prop: Required. + :vartype prop: ~typetest.union.models.MixedLiteralsCases """ - prop: Union[Literal["b"], Literal["c"], str] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Required. Is one of the following types: Literal[\"b\"], Literal[\"c\"], str""" + prop: "_models.MixedLiteralsCases" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" @overload def __init__( self, *, - prop: Union[Literal["b"], Literal["c"], str], + prop: "_models.MixedLiteralsCases", ) -> None: ... @overload @@ -362,18 +362,18 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class GetResponse9(_model_base.Model): """GetResponse9. - :ivar prop: Required. Is one of the following types: Literal["a"], Literal["b"], Literal["c"] - :vartype prop: str or str or str + :ivar prop: Required. + :vartype prop: ~typetest.union.models.MixedTypesCases """ - prop: Literal["a", "b", "c"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required. Is one of the following types: Literal[\"a\"], Literal[\"b\"], Literal[\"c\"]""" + prop: "_models.MixedTypesCases" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" @overload def __init__( self, *, - prop: Literal["a", "b", "c"], + prop: "_models.MixedTypesCases", ) -> None: ... @overload diff --git a/packages/typespec-python/test/azure/generated/typetest-union/typetest/union/operations/_operations.py b/packages/typespec-python/test/azure/generated/typetest-union/typetest/union/operations/_operations.py index 16afbaee306..27221e230e7 100644 --- a/packages/typespec-python/test/azure/generated/typetest-union/typetest/union/operations/_operations.py +++ b/packages/typespec-python/test/azure/generated/typetest-union/typetest/union/operations/_operations.py @@ -337,11 +337,11 @@ def __init__(self, *args, **kwargs): self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def get(self, **kwargs: Any) -> _models.GetResponse9: + def get(self, **kwargs: Any) -> _models.GetResponse: """get. - :return: GetResponse9. The GetResponse9 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse9 + :return: GetResponse. The GetResponse is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -355,7 +355,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse9: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse9] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse] = kwargs.pop("cls", None) _request = build_strings_only_get_request( headers=_headers, @@ -385,7 +385,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse9: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse9, response.json()) + deserialized = _deserialize(_models.GetResponse, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -520,11 +520,11 @@ def __init__(self, *args, **kwargs): self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def get(self, **kwargs: Any) -> _models.GetResponse8: + def get(self, **kwargs: Any) -> _models.GetResponse1: """get. - :return: GetResponse8. The GetResponse8 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse8 + :return: GetResponse1. The GetResponse1 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse1 :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -538,7 +538,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse8: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse8] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse1] = kwargs.pop("cls", None) _request = build_string_extensible_get_request( headers=_headers, @@ -568,7 +568,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse8: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse8, response.json()) + deserialized = _deserialize(_models.GetResponse1, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -707,11 +707,11 @@ def __init__(self, *args, **kwargs): self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def get(self, **kwargs: Any) -> _models.GetResponse7: + def get(self, **kwargs: Any) -> _models.GetResponse2: """get. - :return: GetResponse7. The GetResponse7 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse7 + :return: GetResponse2. The GetResponse2 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse2 :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -725,7 +725,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse7: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse7] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse2] = kwargs.pop("cls", None) _request = build_string_extensible_named_get_request( headers=_headers, @@ -755,7 +755,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse7: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse7, response.json()) + deserialized = _deserialize(_models.GetResponse2, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -898,11 +898,11 @@ def __init__(self, *args, **kwargs): self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def get(self, **kwargs: Any) -> _models.GetResponse6: + def get(self, **kwargs: Any) -> _models.GetResponse3: """get. - :return: GetResponse6. The GetResponse6 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse6 + :return: GetResponse3. The GetResponse3 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse3 :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -916,7 +916,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse6: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse6] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse3] = kwargs.pop("cls", None) _request = build_ints_only_get_request( headers=_headers, @@ -946,7 +946,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse6: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse6, response.json()) + deserialized = _deserialize(_models.GetResponse3, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1079,11 +1079,11 @@ def __init__(self, *args, **kwargs): self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def get(self, **kwargs: Any) -> _models.GetResponse5: + def get(self, **kwargs: Any) -> _models.GetResponse4: """get. - :return: GetResponse5. The GetResponse5 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse5 + :return: GetResponse4. The GetResponse4 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse4 :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1097,7 +1097,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse5: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse5] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse4] = kwargs.pop("cls", None) _request = build_floats_only_get_request( headers=_headers, @@ -1127,7 +1127,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse5: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse5, response.json()) + deserialized = _deserialize(_models.GetResponse4, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1260,11 +1260,11 @@ def __init__(self, *args, **kwargs): self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def get(self, **kwargs: Any) -> _models.GetResponse4: + def get(self, **kwargs: Any) -> _models.GetResponse5: """get. - :return: GetResponse4. The GetResponse4 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse4 + :return: GetResponse5. The GetResponse5 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse5 :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1278,7 +1278,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse4: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse4] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse5] = kwargs.pop("cls", None) _request = build_models_only_get_request( headers=_headers, @@ -1308,7 +1308,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse4: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse4, response.json()) + deserialized = _deserialize(_models.GetResponse5, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1443,11 +1443,11 @@ def __init__(self, *args, **kwargs): self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def get(self, **kwargs: Any) -> _models.GetResponse3: + def get(self, **kwargs: Any) -> _models.GetResponse6: """get. - :return: GetResponse3. The GetResponse3 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse3 + :return: GetResponse6. The GetResponse6 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse6 :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1461,7 +1461,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse3: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse3] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse6] = kwargs.pop("cls", None) _request = build_enums_only_get_request( headers=_headers, @@ -1491,7 +1491,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse3: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse3, response.json()) + deserialized = _deserialize(_models.GetResponse6, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1624,11 +1624,11 @@ def __init__(self, *args, **kwargs): self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def get(self, **kwargs: Any) -> _models.GetResponse2: + def get(self, **kwargs: Any) -> _models.GetResponse7: """get. - :return: GetResponse2. The GetResponse2 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse2 + :return: GetResponse7. The GetResponse7 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse7 :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1642,7 +1642,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse2: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse2] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse7] = kwargs.pop("cls", None) _request = build_string_and_array_get_request( headers=_headers, @@ -1672,7 +1672,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse2: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse2, response.json()) + deserialized = _deserialize(_models.GetResponse7, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1805,11 +1805,11 @@ def __init__(self, *args, **kwargs): self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def get(self, **kwargs: Any) -> _models.GetResponse1: + def get(self, **kwargs: Any) -> _models.GetResponse8: """get. - :return: GetResponse1. The GetResponse1 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse1 + :return: GetResponse8. The GetResponse8 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse8 :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1823,7 +1823,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse1: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse1] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse8] = kwargs.pop("cls", None) _request = build_mixed_literals_get_request( headers=_headers, @@ -1853,7 +1853,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse1: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse1, response.json()) + deserialized = _deserialize(_models.GetResponse8, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1986,11 +1986,11 @@ def __init__(self, *args, **kwargs): self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def get(self, **kwargs: Any) -> _models.GetResponse: + def get(self, **kwargs: Any) -> _models.GetResponse9: """get. - :return: GetResponse. The GetResponse is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse + :return: GetResponse9. The GetResponse9 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse9 :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -2004,7 +2004,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse9] = kwargs.pop("cls", None) _request = build_mixed_types_get_request( headers=_headers, @@ -2034,7 +2034,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse, response.json()) + deserialized = _deserialize(_models.GetResponse9, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore From bc1ee35fa9b738c33a6c0cc80c65ee577f13b873 Mon Sep 17 00:00:00 2001 From: Yuchao Yan Date: Thu, 3 Apr 2025 09:32:31 +0800 Subject: [PATCH 13/19] update --- packages/typespec-python/package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/typespec-python/package.json b/packages/typespec-python/package.json index c62ce8e9b91..a5d11d89f38 100644 --- a/packages/typespec-python/package.json +++ b/packages/typespec-python/package.json @@ -53,6 +53,7 @@ "@typespec/events": ">=0.68.0-dev.3 <1.0.0", "@typespec/sse": ">=0.68.0-dev.3 <1.0.0", "@typespec/streams": ">=0.68.0-dev.3 <1.0.0", + "@typespec/xml": ">=0.68.0-dev.3 <1.0.0", "@azure-tools/typespec-azure-core": "0.54.0-dev.5", "@azure-tools/typespec-azure-resource-manager": "0.54.0-dev.4", "@azure-tools/typespec-autorest": "0.54.0-dev.5", @@ -75,6 +76,7 @@ "@typespec/events": "~0.68.0-dev.3", "@typespec/sse": "~0.68.0-dev.3", "@typespec/streams": "~0.68.0-dev.3", + "@typespec/xml": "~0.68.0", "@azure-tools/typespec-azure-resource-manager": "0.54.0-dev.4", "@azure-tools/typespec-azure-core": "0.54.0-dev.5", "@azure-tools/typespec-azure-rulesets": "0.54.0-dev.2", @@ -82,8 +84,6 @@ "@azure-tools/typespec-client-generator-core": "0.54.0-dev.22", "@azure-tools/azure-http-specs": "0.1.0-alpha.13-dev.2", "@typespec/http-specs": "0.1.0-alpha.17-dev.2", - "@typespec/spec-api": "0.1.0-alpha.4-dev.0", - "@typespec/spector": "0.1.0-alpha.11-dev.2", "@types/js-yaml": "~4.0.5", "@types/node": "~22.13.14", "@types/yargs": "~17.0.33", @@ -97,4 +97,4 @@ "chalk": "5.3.0", "@types/fs-extra": "11.0.4" } -} \ No newline at end of file +} From 4e024a7f25cc737a00e9baa06d33ec2b16b68f4b Mon Sep 17 00:00:00 2001 From: AutoPrFromHttpClientPython Date: Thu, 3 Apr 2025 01:37:16 +0000 Subject: [PATCH 14/19] Update dependencies (2025-04-03 01:37:16) --- packages/autorest.python/package.json | 2 +- packages/typespec-python/package.json | 62 ++-- pnpm-lock.yaml | 516 +++++++++++++++----------- 3 files changed, 322 insertions(+), 258 deletions(-) diff --git a/packages/autorest.python/package.json b/packages/autorest.python/package.json index d3e8dadc336..8489bbf7a5f 100644 --- a/packages/autorest.python/package.json +++ b/packages/autorest.python/package.json @@ -29,7 +29,7 @@ }, "homepage": "https://github.com/Azure/autorest.python/blob/main/README.md", "dependencies": { - "@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcxNDA2NS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.2.tgz", + "@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcxNzQ4OS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.9.0.tgz", "@autorest/system-requirements": "~1.0.2", "fs-extra": "~11.2.0", "tsx": "~4.19.1" diff --git a/packages/typespec-python/package.json b/packages/typespec-python/package.json index a5d11d89f38..c6e5ba8ec19 100644 --- a/packages/typespec-python/package.json +++ b/packages/typespec-python/package.json @@ -45,45 +45,45 @@ "generator/**" ], "peerDependencies": { - "@typespec/compiler": "0.68.0-dev.13", - "@typespec/http": "0.68.0-dev.9", - "@typespec/rest": "0.68.0-dev.4", - "@typespec/versioning": "0.68.0-dev.3", - "@typespec/openapi": "0.68.0-dev.3", - "@typespec/events": ">=0.68.0-dev.3 <1.0.0", - "@typespec/sse": ">=0.68.0-dev.3 <1.0.0", - "@typespec/streams": ">=0.68.0-dev.3 <1.0.0", - "@typespec/xml": ">=0.68.0-dev.3 <1.0.0", - "@azure-tools/typespec-azure-core": "0.54.0-dev.5", - "@azure-tools/typespec-azure-resource-manager": "0.54.0-dev.4", - "@azure-tools/typespec-autorest": "0.54.0-dev.5", - "@azure-tools/typespec-azure-rulesets": "0.54.0-dev.2", - "@azure-tools/typespec-client-generator-core": "0.54.0-dev.22" + "@typespec/compiler": ">=1.0.0-0 <2.0.0", + "@typespec/http": ">=1.0.0-0 <2.0.0", + "@typespec/rest": ">=0.68.0 <1.0.0", + "@typespec/versioning": ">=0.68.0 <1.0.0", + "@typespec/openapi": ">=1.0.0-0 <2.0.0", + "@typespec/events": ">=0.68.0 <1.0.0", + "@typespec/sse": ">=0.68.0 <1.0.0", + "@typespec/streams": ">=0.68.0 <1.0.0", + "@typespec/xml": ">=0.68.0 <1.0.0", + "@azure-tools/typespec-azure-core": ">= 0.54.0 <1.0.0", + "@azure-tools/typespec-azure-resource-manager": ">= 0.54.0 <1.0.0", + "@azure-tools/typespec-autorest": ">= 0.54.0 <1.0.0", + "@azure-tools/typespec-azure-rulesets": ">= 0.54.0 <1.0.0", + "@azure-tools/typespec-client-generator-core": ">= 0.54.0 <1.0.0" }, "dependencies": { "js-yaml": "~4.1.0", "semver": "~7.6.2", "tsx": "~4.19.1", - "@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcxNDA2NS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.2.tgz", + "@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcxNzQ4OS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.9.0.tgz", "fs-extra": "~11.2.0" }, "devDependencies": { - "@typespec/compiler": "0.68.0-dev.13", - "@typespec/http": "0.68.0-dev.9", - "@typespec/rest": "0.68.0-dev.4", - "@typespec/versioning": "0.68.0-dev.3", - "@typespec/openapi": "0.68.0-dev.3", - "@typespec/events": "~0.68.0-dev.3", - "@typespec/sse": "~0.68.0-dev.3", - "@typespec/streams": "~0.68.0-dev.3", + "@typespec/compiler": "^1.0.0-0", + "@typespec/http": "^1.0.0-0", + "@typespec/rest": "~0.68.0", + "@typespec/versioning": "~0.68.0", + "@typespec/openapi": "^1.0.0-0", + "@typespec/events": "~0.68.0", + "@typespec/sse": "~0.68.0", + "@typespec/streams": "~0.68.0", "@typespec/xml": "~0.68.0", - "@azure-tools/typespec-azure-resource-manager": "0.54.0-dev.4", - "@azure-tools/typespec-azure-core": "0.54.0-dev.5", - "@azure-tools/typespec-azure-rulesets": "0.54.0-dev.2", - "@azure-tools/typespec-autorest": "0.54.0-dev.5", - "@azure-tools/typespec-client-generator-core": "0.54.0-dev.22", - "@azure-tools/azure-http-specs": "0.1.0-alpha.13-dev.2", - "@typespec/http-specs": "0.1.0-alpha.17-dev.2", + "@azure-tools/typespec-azure-resource-manager": "~0.54.0", + "@azure-tools/typespec-azure-core": "~0.54.0", + "@azure-tools/typespec-azure-rulesets": "~0.54.0", + "@azure-tools/typespec-autorest": "~0.54.0", + "@azure-tools/typespec-client-generator-core": "~0.54.0", + "@azure-tools/azure-http-specs": "0.1.0-alpha.13", + "@typespec/http-specs": "0.1.0-alpha.17", "@types/js-yaml": "~4.0.5", "@types/node": "~22.13.14", "@types/yargs": "~17.0.33", @@ -97,4 +97,4 @@ "chalk": "5.3.0", "@types/fs-extra": "11.0.4" } -} +} \ No newline at end of file diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 27f92232674..f5175ccaa40 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -57,8 +57,8 @@ importers: specifier: ~1.0.2 version: 1.0.2 '@typespec/http-client-python': - specifier: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcxNDA2NS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.2.tgz - version: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcxNDA2NS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.2.tgz(7lctz6vgqeif7iqlya3bzwoexa) + specifier: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcxNzQ4OS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.9.0.tgz + version: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcxNzQ4OS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.9.0.tgz(2ivfmxvrftapo7cbuxsaae6yq4) fs-extra: specifier: ~11.2.0 version: 11.2.0 @@ -79,8 +79,8 @@ importers: packages/typespec-python: dependencies: '@typespec/http-client-python': - specifier: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcxNDA2NS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.2.tgz - version: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcxNDA2NS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.2.tgz(7lctz6vgqeif7iqlya3bzwoexa) + specifier: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcxNzQ4OS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.9.0.tgz + version: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcxNzQ4OS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.9.0.tgz(2ivfmxvrftapo7cbuxsaae6yq4) fs-extra: specifier: ~11.2.0 version: 11.2.0 @@ -95,23 +95,23 @@ importers: version: 4.19.3 devDependencies: '@azure-tools/azure-http-specs': - specifier: 0.1.0-alpha.13-dev.2 - version: 0.1.0-alpha.13-dev.2(2qclodw5tqlmu4xopqkjoaoqw4) + specifier: 0.1.0-alpha.13 + version: 0.1.0-alpha.13(gfm3f7krb5pm5nvwh6qqwmbzcy) '@azure-tools/typespec-autorest': - specifier: 0.54.0-dev.5 - version: 0.54.0-dev.5(slqx2jlvr2rb5u5z3itjv7na4u) + specifier: ~0.54.0 + version: 0.54.0(eijwshhpe4ydfv4uxokr3dajqe) '@azure-tools/typespec-azure-core': - specifier: 0.54.0-dev.5 - version: 0.54.0-dev.5(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))))(@typespec/rest@0.68.0-dev.4(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))))) + specifier: ~0.54.0 + version: 0.54.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/http@1.0.0-rc.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/streams@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))))(@typespec/rest@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/http@1.0.0-rc.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/streams@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))))) '@azure-tools/typespec-azure-resource-manager': - specifier: 0.54.0-dev.4 - version: 0.54.0-dev.4(qb3xdiittordn2dqsr2n6il7zy) + specifier: ~0.54.0 + version: 0.54.0(sq74qt2k6r4fvjwy37msq4cl7a) '@azure-tools/typespec-azure-rulesets': - specifier: 0.54.0-dev.2 - version: 0.54.0-dev.2(@azure-tools/typespec-azure-core@0.54.0-dev.5(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))))(@typespec/rest@0.68.0-dev.4(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))))))(@azure-tools/typespec-azure-resource-manager@0.54.0-dev.4(qb3xdiittordn2dqsr2n6il7zy))(@azure-tools/typespec-client-generator-core@0.54.0-dev.22(llvaf3qoefvnsvhamv54x3g4pe))(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)) + specifier: ~0.54.0 + version: 0.54.0(@azure-tools/typespec-azure-core@0.54.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/http@1.0.0-rc.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/streams@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))))(@typespec/rest@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/http@1.0.0-rc.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/streams@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))))))(@azure-tools/typespec-azure-resource-manager@0.54.0(sq74qt2k6r4fvjwy37msq4cl7a))(@azure-tools/typespec-client-generator-core@0.54.0(qizmnx62cykc7f5nejydwkmymm))(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17)) '@azure-tools/typespec-client-generator-core': - specifier: 0.54.0-dev.22 - version: 0.54.0-dev.22(llvaf3qoefvnsvhamv54x3g4pe) + specifier: ~0.54.0 + version: 0.54.0(qizmnx62cykc7f5nejydwkmymm) '@types/fs-extra': specifier: 11.0.4 version: 11.0.4 @@ -128,38 +128,35 @@ importers: specifier: ~17.0.33 version: 17.0.33 '@typespec/compiler': - specifier: 0.68.0-dev.13 - version: 0.68.0-dev.13(@types/node@22.13.17) + specifier: ^1.0.0-0 + version: 1.0.0-rc.0(@types/node@22.13.17) '@typespec/events': - specifier: ~0.68.0-dev.3 - version: 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)) + specifier: ~0.68.0 + version: 0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17)) '@typespec/http': - specifier: 0.68.0-dev.9 - version: 0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))) + specifier: ^1.0.0-0 + version: 1.0.0-rc.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/streams@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))) '@typespec/http-specs': - specifier: 0.1.0-alpha.17-dev.2 - version: 0.1.0-alpha.17-dev.2(@types/node@22.13.17)(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))))(@typespec/rest@0.68.0-dev.4(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)))))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)))(@typespec/versioning@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)))(@typespec/xml@0.59.0(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))) + specifier: 0.1.0-alpha.17 + version: 0.1.0-alpha.17(@types/node@22.13.17)(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/http@1.0.0-rc.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/streams@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))))(@typespec/rest@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/http@1.0.0-rc.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/streams@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17)))))(@typespec/streams@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17)))(@typespec/versioning@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17)))(@typespec/xml@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))) '@typespec/openapi': - specifier: 0.68.0-dev.3 - version: 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)))) + specifier: ^1.0.0-0 + version: 1.0.0-rc.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/http@1.0.0-rc.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/streams@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17)))) '@typespec/rest': - specifier: 0.68.0-dev.4 - version: 0.68.0-dev.4(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)))) - '@typespec/spec-api': - specifier: 0.1.0-alpha.4-dev.0 - version: 0.1.0-alpha.4-dev.0 - '@typespec/spector': - specifier: 0.1.0-alpha.11-dev.2 - version: 0.1.0-alpha.11-dev.2(@types/node@22.13.17)(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))) + specifier: ~0.68.0 + version: 0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/http@1.0.0-rc.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/streams@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17)))) '@typespec/sse': - specifier: ~0.68.0-dev.3 - version: 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/events@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))) + specifier: ~0.68.0 + version: 0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/events@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17)))(@typespec/http@1.0.0-rc.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/streams@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))))(@typespec/streams@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))) '@typespec/streams': - specifier: ~0.68.0-dev.3 - version: 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)) + specifier: ~0.68.0 + version: 0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17)) '@typespec/versioning': - specifier: 0.68.0-dev.3 - version: 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)) + specifier: ~0.68.0 + version: 0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17)) + '@typespec/xml': + specifier: ~0.68.0 + version: 0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17)) c8: specifier: ^10.1.3 version: 10.1.3 @@ -194,72 +191,72 @@ packages: resolution: {integrity: sha512-T21naRb6JDdjjn2s/zwr9iCIv/9jviL/PRtiWAhi+3UA2WKH2wrId2VqJa4uVD7iEV8BLkuGgFmMkaMBG26hFw==} engines: {node: '>=12.0.0'} - '@azure-tools/azure-http-specs@0.1.0-alpha.13-dev.2': - resolution: {integrity: sha512-CQc0bk3YKjnhp1DI4u9NVBm1imkNJNxUjO98JbR6/rQP6OblJCmE4bYG5ahtAYaSlceJaAn5K89TTDhcoMZJkg==} + '@azure-tools/azure-http-specs@0.1.0-alpha.13': + resolution: {integrity: sha512-viKd9OK5rQbuwIiH9ihYQBjvXg/14XH94d3YdeMuTzGaceCbJxqrj/mm/XLPWrT+kHt3rEUhf06TEsmLGdqECQ==} engines: {node: '>=20.0.0'} peerDependencies: - '@azure-tools/typespec-azure-core': ^0.53.0 || >=0.54.0-dev <0.54.0 - '@typespec/compiler': ^0.67.2 || >=0.68.0-dev <0.68.0 - '@typespec/http': ^0.67.1 || >=0.68.0-dev <0.68.0 - '@typespec/rest': ^0.67.1 || >=0.68.0-dev <0.68.0 - '@typespec/versioning': ^0.67.1 || >=0.68.0-dev <0.68.0 - '@typespec/xml': ^0.67.1 || >=0.68.0-dev <0.68.0 - - '@azure-tools/typespec-autorest@0.54.0-dev.5': - resolution: {integrity: sha512-jOB9mX76zd9GazTKJjLiET/F62bfhlFhbq7996WoA/CwkvfL55EuYTpfQbxsLdYySXooxYKc7QnYBmhL6CwvBA==} + '@azure-tools/typespec-azure-core': ^0.54.0 + '@typespec/compiler': ^1.0.0-rc.0 + '@typespec/http': ^1.0.0-rc.0 + '@typespec/rest': ^0.68.0 + '@typespec/versioning': ^0.68.0 + '@typespec/xml': ^0.68.0 + + '@azure-tools/typespec-autorest@0.54.0': + resolution: {integrity: sha512-7Oh8R48CQfeiFFfrMTKdEozpx/riQe+KENkd6wn1Oku7aZJ/GDsPidwiu98sCBeSXeJhc3/UlHmxMZWgiat5KQ==} engines: {node: '>=20.0.0'} peerDependencies: - '@azure-tools/typespec-azure-core': ^0.53.0 || >=0.54.0-dev <0.54.0 - '@azure-tools/typespec-azure-resource-manager': ^0.53.0 || >=0.54.0-dev <0.54.0 - '@azure-tools/typespec-client-generator-core': ^0.53.1 || >=0.54.0-dev <0.54.0 - '@typespec/compiler': ^0.67.2 || >=0.68.0-dev <0.68.0 - '@typespec/http': ^0.67.1 || >=0.68.0-dev <0.68.0 - '@typespec/openapi': ^0.67.1 || >=0.68.0-dev <0.68.0 - '@typespec/rest': ^0.67.1 || >=0.68.0-dev <0.68.0 - '@typespec/versioning': ^0.67.1 || >=0.68.0-dev <0.68.0 - - '@azure-tools/typespec-azure-core@0.54.0-dev.5': - resolution: {integrity: sha512-Am9PNrnb/fUw9E0oWCZwsi2Znx8bFz4dLe1heo+GaDJOEsH1vLzwbOCspm1pVpeZVi58HnVh0gt4nsYprauIaQ==} + '@azure-tools/typespec-azure-core': ^0.54.0 + '@azure-tools/typespec-azure-resource-manager': ^0.54.0 + '@azure-tools/typespec-client-generator-core': ^0.54.0 + '@typespec/compiler': ^1.0.0-rc.0 + '@typespec/http': ^1.0.0-rc.0 + '@typespec/openapi': ^1.0.0-rc.0 + '@typespec/rest': ^0.68.0 + '@typespec/versioning': ^0.68.0 + + '@azure-tools/typespec-azure-core@0.54.0': + resolution: {integrity: sha512-rlUK9j/1mHUHaNPzOibz1aeeUnROOrNlTPDmnHOfbo4WP0NwV4tDU3rnoUCZxwabVQGKb9U7VTsunb74AzAafg==} engines: {node: '>=20.0.0'} peerDependencies: - '@typespec/compiler': ^0.67.2 || >=0.68.0-dev <0.68.0 - '@typespec/http': ^0.67.1 || >=0.68.0-dev <0.68.0 - '@typespec/rest': ^0.67.1 || >=0.68.0-dev <0.68.0 + '@typespec/compiler': ^1.0.0-rc.0 + '@typespec/http': ^1.0.0-rc.0 + '@typespec/rest': ^0.68.0 - '@azure-tools/typespec-azure-resource-manager@0.54.0-dev.4': - resolution: {integrity: sha512-P5a4m2umzEse3/VwgrRvJSQVoaqWW7TfsuYcFvFr+qhr7cHhmfROoOcZAf2fO26kQa7HQX0x5T/2iGT9YP7l1w==} + '@azure-tools/typespec-azure-resource-manager@0.54.0': + resolution: {integrity: sha512-SKBMvBy3wD44ZIHjOmQcvYgWYnk4WcDOhXn1kLSgiYiX74zpv48G9sl8ic1AneREq5UtGNwZ4rdMFWY7BW+8hg==} engines: {node: '>=20.0.0'} peerDependencies: - '@azure-tools/typespec-azure-core': ^0.53.0 || >=0.54.0-dev <0.54.0 - '@typespec/compiler': ^0.67.2 || >=0.68.0-dev <0.68.0 - '@typespec/http': ^0.67.1 || >=0.68.0-dev <0.68.0 - '@typespec/openapi': ^0.67.1 || >=0.68.0-dev <0.68.0 - '@typespec/rest': ^0.67.1 || >=0.68.0-dev <0.68.0 - '@typespec/versioning': ^0.67.1 || >=0.68.0-dev <0.68.0 - - '@azure-tools/typespec-azure-rulesets@0.54.0-dev.2': - resolution: {integrity: sha512-qW9nxMQh0eOxiEQWjM/ADhbIfOoVec/c/95pRBbX5DPL0rkj9u3iQxENyNDfcVfl7XGlG7/Z/cmwJYgvIj6RJA==} + '@azure-tools/typespec-azure-core': ^0.54.0 + '@typespec/compiler': ^1.0.0-rc.0 + '@typespec/http': ^1.0.0-rc.0 + '@typespec/openapi': ^1.0.0-rc.0 + '@typespec/rest': ^0.68.0 + '@typespec/versioning': ^0.68.0 + + '@azure-tools/typespec-azure-rulesets@0.54.0': + resolution: {integrity: sha512-Pupm5D76JEV4SMesXEEpei7JcErJSt0agVMXH9KjFXRfUYX+coBwfkP+mu3ViZQ+DRgC21qyHk8SxT2ffxxK2Q==} engines: {node: '>=20.0.0'} peerDependencies: - '@azure-tools/typespec-azure-core': ^0.53.0 || >=0.54.0-dev <0.54.0 - '@azure-tools/typespec-azure-resource-manager': ^0.53.0 || >=0.54.0-dev <0.54.0 - '@azure-tools/typespec-client-generator-core': ^0.53.1 || >=0.54.0-dev <0.54.0 - '@typespec/compiler': ^0.67.1 || >=0.68.0-dev <0.68.0 + '@azure-tools/typespec-azure-core': ^0.54.0 + '@azure-tools/typespec-azure-resource-manager': ^0.54.0 + '@azure-tools/typespec-client-generator-core': ^0.54.0 + '@typespec/compiler': ^1.0.0-rc.0 - '@azure-tools/typespec-client-generator-core@0.54.0-dev.22': - resolution: {integrity: sha512-BzI1pt7vuInUyCLH8QpZWqko9q5a53ch4gg4zGBQk0K/nfMPh0xzVeCYyYTDqpxAjyUqjei+JLo4W8u21yiXiw==} + '@azure-tools/typespec-client-generator-core@0.54.0': + resolution: {integrity: sha512-qZR6FgB+wKfF5aRQtEwjUo6xgw1MomqyFwJf6WL+xstHDs7np3jBja43OCdJaooPzAknYWh2V+Hv77/fLFd9Aw==} engines: {node: '>=20.0.0'} peerDependencies: - '@azure-tools/typespec-azure-core': ^0.53.0 || >=0.54.0-dev <0.54.0 - '@typespec/compiler': ^0.67.2 || >=0.68.0-dev <0.68.0 - '@typespec/events': ^0.67.1 || >=0.68.0-dev <0.68.0 - '@typespec/http': ^0.67.1 || >=0.68.0-dev <0.68.0 - '@typespec/openapi': ^0.67.1 || >=0.68.0-dev <0.68.0 - '@typespec/rest': ^0.67.1 || >=0.68.0-dev <0.68.0 - '@typespec/sse': ^0.67.1 || >=0.68.0-dev <0.68.0 - '@typespec/streams': ^0.67.1 || >=0.68.0-dev <0.68.0 - '@typespec/versioning': ^0.67.1 || >=0.68.0-dev <0.68.0 - '@typespec/xml': ^0.67.1 || >=0.68.0-dev <0.68.0 + '@azure-tools/typespec-azure-core': ^0.54.0 + '@typespec/compiler': ^1.0.0-rc.0 + '@typespec/events': ^0.68.0 + '@typespec/http': ^1.0.0-rc.0 + '@typespec/openapi': ^1.0.0-rc.0 + '@typespec/rest': ^0.68.0 + '@typespec/sse': ^0.68.0 + '@typespec/streams': ^0.68.0 + '@typespec/versioning': ^0.68.0 + '@typespec/xml': ^0.68.0 '@azure/abort-controller@2.1.2': resolution: {integrity: sha512-nBrLsEWm4J2u5LpAPjxADTlq3trDgVZZXHNKabeXZtpq3d3AbN/KGO82R87rdDz5/lYB024rtEf10/q0urNgsA==} @@ -1530,40 +1527,46 @@ packages: engines: {node: '>=20.0.0'} hasBin: true - '@typespec/events@0.68.0-dev.3': - resolution: {integrity: sha512-BhZtrLxTIbGXZfLae4YcfXgw3ijBlyNFJEckKrH9jgKjZyE6ybQ3BxgAJGSNMRGykx+gBJJOnpDgHRt+ATg+/g==} + '@typespec/compiler@1.0.0-rc.0': + resolution: {integrity: sha512-2N5DCFzuPt5rPXReE4T1boZrG60sr3dTMgZOS/WX+Rosc6iFj2v1ULTI2ySXk/Abd3oxS5OR24l8veIWEi0lzw==} + engines: {node: '>=20.0.0'} + hasBin: true + + '@typespec/events@0.68.0': + resolution: {integrity: sha512-U2y9K8QJ6HsmNxEyHz2aG2bmD05FIsLkmIZgmNaHDwhN1oyI8EH1NkxvwZCnEkPAN7ReuLYK6blouWFWX3s5eg==} engines: {node: '>=20.0.0'} peerDependencies: - '@typespec/compiler': ^0.67.2 || >=0.68.0-dev <0.68.0 + '@typespec/compiler': ^1.0.0-rc.0 - '@typespec/http-client-python@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcxNDA2NS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.2.tgz': - resolution: {tarball: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcxNDA2NS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.2.tgz} - version: 0.8.2 + '@typespec/http-client-python@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcxNzQ4OS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.9.0.tgz': + resolution: {tarball: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcxNzQ4OS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.9.0.tgz} + version: 0.9.0 engines: {node: '>=20.0.0'} peerDependencies: - '@azure-tools/typespec-autorest': 0.54.0-dev.5 - '@azure-tools/typespec-azure-core': 0.54.0-dev.5 - '@azure-tools/typespec-azure-resource-manager': 0.54.0-dev.4 - '@azure-tools/typespec-azure-rulesets': 0.54.0-dev.2 - '@azure-tools/typespec-client-generator-core': 0.54.0-dev.22 - '@typespec/compiler': 0.68.0-dev.13 - '@typespec/events': '>=0.68.0-dev.3 <1.0.0' - '@typespec/http': 0.68.0-dev.9 - '@typespec/openapi': 0.68.0-dev.3 - '@typespec/rest': 0.68.0-dev.4 - '@typespec/sse': '>=0.68.0-dev.3 <1.0.0' - '@typespec/streams': '>=0.68.0-dev.3 <1.0.0' - '@typespec/versioning': 0.68.0-dev.3 - - '@typespec/http-specs@0.1.0-alpha.17-dev.2': - resolution: {integrity: sha512-AOscz0jFO76pbv+FU9pnFIr7ec794qqF6lUubKrABJtb7MwMdaS5/0fkA2pbgvlR/8OyfqiqXeCB4Aoqg51n3g==} + '@azure-tools/typespec-autorest': '>= 0.54.0 <1.0.0' + '@azure-tools/typespec-azure-core': '>= 0.54.0 <1.0.0' + '@azure-tools/typespec-azure-resource-manager': '>= 0.54.0 <1.0.0' + '@azure-tools/typespec-azure-rulesets': '>= 0.54.0 <1.0.0' + '@azure-tools/typespec-client-generator-core': '>= 0.54.0 <1.0.0' + '@typespec/compiler': '>=1.0.0-0 <2.0.0' + '@typespec/events': '>=0.68.0 <1.0.0' + '@typespec/http': '>=1.0.0-0 <2.0.0' + '@typespec/openapi': '>=1.0.0-0 <2.0.0' + '@typespec/rest': '>=0.68.0 <1.0.0' + '@typespec/sse': '>=0.68.0 <1.0.0' + '@typespec/streams': '>=0.68.0 <1.0.0' + '@typespec/versioning': '>=0.68.0 <1.0.0' + '@typespec/xml': '>=0.68.0 <1.0.0' + + '@typespec/http-specs@0.1.0-alpha.17': + resolution: {integrity: sha512-nwifWlVfq5vDpfrLufaRAOw+vT9owBU9qlrJ2wtrki8Y5dognGnFwi7pEz23KgbySL3x/WmtwY6x40kSH4tHlg==} engines: {node: '>=16.0.0'} peerDependencies: - '@typespec/compiler': ^0.67.2 || >=0.68.0-dev <0.68.0 - '@typespec/http': ^0.67.1 || >=0.68.0-dev <0.68.0 - '@typespec/rest': ^0.67.1 || >=0.68.0-dev <0.68.0 - '@typespec/versioning': ^0.67.1 || >=0.68.0-dev <0.68.0 - '@typespec/xml': ^0.67.1 || >=0.68.0-dev <0.68.0 + '@typespec/compiler': ^1.0.0-rc.0 + '@typespec/http': ^1.0.0-rc.0 + '@typespec/rest': ^0.68.0 + '@typespec/versioning': ^0.68.0 + '@typespec/xml': ^0.68.0 '@typespec/http@0.68.0-dev.9': resolution: {integrity: sha512-p4pjqhY2EPzhBLmS0ohaZaYwJdezXgeUKQNrhzHR8ckt7qWkOOXNggPngPiXTVxgxYwAM5Zi/BvWrUxMbiqU3g==} @@ -1575,12 +1578,29 @@ packages: '@typespec/streams': optional: true - '@typespec/openapi@0.68.0-dev.3': - resolution: {integrity: sha512-iBj6c1SyDqOgoFT/Kc+R3C4xZE+jQhqTlqRiXf4BKsENYCDhsAmA0nI/Sl1kFFIBm8TD2egcMQzYRlyo3sHnbQ==} + '@typespec/http@1.0.0-rc.0': + resolution: {integrity: sha512-Or2hhDXy8DZZoy3B/HudSrRHTFomiv6DI3vRpPKYT9ocIAxMGo1hQvqKye8uVk/QIMn/ouv6JUlP+pqjpfnPyw==} engines: {node: '>=20.0.0'} peerDependencies: - '@typespec/compiler': ^0.67.2 || >=0.68.0-dev <0.68.0 - '@typespec/http': ^0.67.1 || >=0.68.0-dev <0.68.0 + '@typespec/compiler': ^1.0.0-rc.0 + '@typespec/streams': ^0.68.0 + peerDependenciesMeta: + '@typespec/streams': + optional: true + + '@typespec/openapi@1.0.0-rc.0': + resolution: {integrity: sha512-aswkRlzFI44CGe05qkzInA7jEhUKNxZYToYi5kXz05Jl5d4nh4VeEkCweb2pRL+4LKd2SZiOn09nXm+OKp5EoQ==} + engines: {node: '>=20.0.0'} + peerDependencies: + '@typespec/compiler': ^1.0.0-rc.0 + '@typespec/http': ^1.0.0-rc.0 + + '@typespec/rest@0.68.0': + resolution: {integrity: sha512-VJBEpC0MCFPPN6acc5o0fwQm4WMjMEl3aBHE+71XYkagsqb31rYSyfgfBMvHWaEMJV4dVk5T787/q6AWDzEE8g==} + engines: {node: '>=20.0.0'} + peerDependencies: + '@typespec/compiler': ^1.0.0-rc.0 + '@typespec/http': ^1.0.0-rc.0 '@typespec/rest@0.68.0-dev.4': resolution: {integrity: sha512-Sov7HNQr5IBfu0wbkY3pxUFLPb13ptW2cu/F1Ix1HwIzJ+6045A5vtaeOu5zAwPojDgcmTvsY8qBgTeYbfeiJg==} @@ -1602,20 +1622,26 @@ packages: engines: {node: '>=16.0.0'} hasBin: true - '@typespec/sse@0.68.0-dev.3': - resolution: {integrity: sha512-XaTLVAIZ0ZxZ5nKP5LmXk0x+VS1pNUXi32TzzF1fQMFNMTvIQXv7JKgZkw9rMPE1sQf6pq0kfw2Hfikn+2SPDw==} + '@typespec/sse@0.68.0': + resolution: {integrity: sha512-sePc+14iw8BZjBPwBaCL23y7lDWrUtmoYuPbfxJhRcIzbv2ww5d7mjvv5C2fjWyfRvG7tJ6wDk8YoHQJDoqtVA==} engines: {node: '>=20.0.0'} peerDependencies: - '@typespec/compiler': ^0.67.2 || >=0.68.0-dev <0.68.0 - '@typespec/events': ^0.67.1 || >=0.68.0-dev <0.68.0 - '@typespec/http': ^0.67.1 || >=0.68.0-dev <0.68.0 - '@typespec/streams': ^0.67.1 || >=0.68.0-dev <0.68.0 + '@typespec/compiler': ^1.0.0-rc.0 + '@typespec/events': ^0.68.0 + '@typespec/http': ^1.0.0-rc.0 + '@typespec/streams': ^0.68.0 - '@typespec/streams@0.68.0-dev.3': - resolution: {integrity: sha512-p5HWk0WyEqjuFEuHa/3Ea5zuebm9ZuummnTbkv+qPusiwv/6va8Bb4m4jzJfzBsz1eETtcr+2i64KGEIg/kXqQ==} + '@typespec/streams@0.68.0': + resolution: {integrity: sha512-FsyPYOcPA6CDptdsAI0kiwR9tG6pngf5Bi4PiKTsXwseu93v5Y4keLNr4SR+bNQQK6uYIm0OkoK34Z6qn6uZEw==} engines: {node: '>=20.0.0'} peerDependencies: - '@typespec/compiler': ^0.67.2 || >=0.68.0-dev <0.68.0 + '@typespec/compiler': ^1.0.0-rc.0 + + '@typespec/versioning@0.68.0': + resolution: {integrity: sha512-nsK0hbOeqfsNo1dsP64A4Ks0C/FEk5WJ5LEfgTwvFGdE48mHrj7UJdp58Ps5F6moiR9U20P1rHbo+mE0LDIRvA==} + engines: {node: '>=20.0.0'} + peerDependencies: + '@typespec/compiler': ^1.0.0-rc.0 '@typespec/versioning@0.68.0-dev.3': resolution: {integrity: sha512-shhujRKXKEELOwQ54dbzhtttkYCh8yPwDriZ/KQSprPO1SGInhjVxhzZaIx0Qaz+41Xxs53Ay96b/40eNXGLAg==} @@ -1623,11 +1649,11 @@ packages: peerDependencies: '@typespec/compiler': ^0.67.2 || >=0.68.0-dev <0.68.0 - '@typespec/xml@0.59.0': - resolution: {integrity: sha512-UoSsEmm7SXEtL9OXsqotu1TjruJSobqZMhUKAAlC9EP2WfQIHLRfBu7xaZB0sgwq7CM6zy/Hq1RZfQyL1KqEvg==} - engines: {node: '>=18.0.0'} + '@typespec/xml@0.68.0': + resolution: {integrity: sha512-uB904g9KMkuYKmGZnJsuozjPX+AKzZNStdXvMLq8+TkOitpJcb1dHtFH6KufG21xWuF0bmRUSkJvO4MOsuQNLA==} + engines: {node: '>=20.0.0'} peerDependencies: - '@typespec/compiler': ~0.59.0 + '@typespec/compiler': ^1.0.0-rc.0 '@vitest/expect@3.0.8': resolution: {integrity: sha512-Xu6TTIavTvSSS6LZaA3EebWFr6tsoXPetOWNMOlc7LO88QVVBwq2oQWBoDiLCN6YTvNYsGSjqOO8CAdjom5DCQ==} @@ -4413,68 +4439,68 @@ snapshots: command-exists: 1.2.9 semver: 7.6.3 - '@azure-tools/azure-http-specs@0.1.0-alpha.13-dev.2(2qclodw5tqlmu4xopqkjoaoqw4)': + '@azure-tools/azure-http-specs@0.1.0-alpha.13(gfm3f7krb5pm5nvwh6qqwmbzcy)': dependencies: - '@azure-tools/typespec-azure-core': 0.54.0-dev.5(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))))(@typespec/rest@0.68.0-dev.4(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))))) - '@typespec/compiler': 0.68.0-dev.13(@types/node@22.13.17) - '@typespec/http': 0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))) - '@typespec/rest': 0.68.0-dev.4(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)))) + '@azure-tools/typespec-azure-core': 0.54.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/http@1.0.0-rc.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/streams@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))))(@typespec/rest@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/http@1.0.0-rc.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/streams@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))))) + '@typespec/compiler': 1.0.0-rc.0(@types/node@22.13.17) + '@typespec/http': 1.0.0-rc.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/streams@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))) + '@typespec/rest': 0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/http@1.0.0-rc.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/streams@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17)))) '@typespec/spec-api': 0.1.0-alpha.4-dev.0 - '@typespec/spector': 0.1.0-alpha.11-dev.2(@types/node@22.13.17)(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))) - '@typespec/versioning': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)) - '@typespec/xml': 0.59.0(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)) + '@typespec/spector': 0.1.0-alpha.11-dev.2(@types/node@22.13.17)(@typespec/streams@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))) + '@typespec/versioning': 0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17)) + '@typespec/xml': 0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17)) transitivePeerDependencies: - '@types/node' - '@typespec/streams' - supports-color - '@azure-tools/typespec-autorest@0.54.0-dev.5(slqx2jlvr2rb5u5z3itjv7na4u)': + '@azure-tools/typespec-autorest@0.54.0(eijwshhpe4ydfv4uxokr3dajqe)': dependencies: - '@azure-tools/typespec-azure-core': 0.54.0-dev.5(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))))(@typespec/rest@0.68.0-dev.4(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))))) - '@azure-tools/typespec-azure-resource-manager': 0.54.0-dev.4(qb3xdiittordn2dqsr2n6il7zy) - '@azure-tools/typespec-client-generator-core': 0.54.0-dev.22(llvaf3qoefvnsvhamv54x3g4pe) - '@typespec/compiler': 0.68.0-dev.13(@types/node@22.13.17) - '@typespec/http': 0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))) - '@typespec/openapi': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)))) - '@typespec/rest': 0.68.0-dev.4(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)))) - '@typespec/versioning': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)) + '@azure-tools/typespec-azure-core': 0.54.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/http@1.0.0-rc.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/streams@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))))(@typespec/rest@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/http@1.0.0-rc.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/streams@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))))) + '@azure-tools/typespec-azure-resource-manager': 0.54.0(sq74qt2k6r4fvjwy37msq4cl7a) + '@azure-tools/typespec-client-generator-core': 0.54.0(qizmnx62cykc7f5nejydwkmymm) + '@typespec/compiler': 1.0.0-rc.0(@types/node@22.13.17) + '@typespec/http': 1.0.0-rc.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/streams@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))) + '@typespec/openapi': 1.0.0-rc.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/http@1.0.0-rc.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/streams@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17)))) + '@typespec/rest': 0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/http@1.0.0-rc.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/streams@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17)))) + '@typespec/versioning': 0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17)) - '@azure-tools/typespec-azure-core@0.54.0-dev.5(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))))(@typespec/rest@0.68.0-dev.4(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)))))': + '@azure-tools/typespec-azure-core@0.54.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/http@1.0.0-rc.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/streams@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))))(@typespec/rest@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/http@1.0.0-rc.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/streams@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17)))))': dependencies: - '@typespec/compiler': 0.68.0-dev.13(@types/node@22.13.17) - '@typespec/http': 0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))) - '@typespec/rest': 0.68.0-dev.4(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)))) + '@typespec/compiler': 1.0.0-rc.0(@types/node@22.13.17) + '@typespec/http': 1.0.0-rc.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/streams@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))) + '@typespec/rest': 0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/http@1.0.0-rc.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/streams@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17)))) - '@azure-tools/typespec-azure-resource-manager@0.54.0-dev.4(qb3xdiittordn2dqsr2n6il7zy)': + '@azure-tools/typespec-azure-resource-manager@0.54.0(sq74qt2k6r4fvjwy37msq4cl7a)': dependencies: - '@azure-tools/typespec-azure-core': 0.54.0-dev.5(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))))(@typespec/rest@0.68.0-dev.4(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))))) - '@typespec/compiler': 0.68.0-dev.13(@types/node@22.13.17) - '@typespec/http': 0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))) - '@typespec/openapi': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)))) - '@typespec/rest': 0.68.0-dev.4(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)))) - '@typespec/versioning': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)) + '@azure-tools/typespec-azure-core': 0.54.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/http@1.0.0-rc.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/streams@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))))(@typespec/rest@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/http@1.0.0-rc.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/streams@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))))) + '@typespec/compiler': 1.0.0-rc.0(@types/node@22.13.17) + '@typespec/http': 1.0.0-rc.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/streams@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))) + '@typespec/openapi': 1.0.0-rc.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/http@1.0.0-rc.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/streams@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17)))) + '@typespec/rest': 0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/http@1.0.0-rc.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/streams@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17)))) + '@typespec/versioning': 0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17)) change-case: 5.4.4 pluralize: 8.0.0 - '@azure-tools/typespec-azure-rulesets@0.54.0-dev.2(@azure-tools/typespec-azure-core@0.54.0-dev.5(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))))(@typespec/rest@0.68.0-dev.4(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))))))(@azure-tools/typespec-azure-resource-manager@0.54.0-dev.4(qb3xdiittordn2dqsr2n6il7zy))(@azure-tools/typespec-client-generator-core@0.54.0-dev.22(llvaf3qoefvnsvhamv54x3g4pe))(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))': - dependencies: - '@azure-tools/typespec-azure-core': 0.54.0-dev.5(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))))(@typespec/rest@0.68.0-dev.4(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))))) - '@azure-tools/typespec-azure-resource-manager': 0.54.0-dev.4(qb3xdiittordn2dqsr2n6il7zy) - '@azure-tools/typespec-client-generator-core': 0.54.0-dev.22(llvaf3qoefvnsvhamv54x3g4pe) - '@typespec/compiler': 0.68.0-dev.13(@types/node@22.13.17) - - '@azure-tools/typespec-client-generator-core@0.54.0-dev.22(llvaf3qoefvnsvhamv54x3g4pe)': - dependencies: - '@azure-tools/typespec-azure-core': 0.54.0-dev.5(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))))(@typespec/rest@0.68.0-dev.4(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))))) - '@typespec/compiler': 0.68.0-dev.13(@types/node@22.13.17) - '@typespec/events': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)) - '@typespec/http': 0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))) - '@typespec/openapi': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)))) - '@typespec/rest': 0.68.0-dev.4(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)))) - '@typespec/sse': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/events@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))) - '@typespec/streams': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)) - '@typespec/versioning': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)) - '@typespec/xml': 0.59.0(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)) + '@azure-tools/typespec-azure-rulesets@0.54.0(@azure-tools/typespec-azure-core@0.54.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/http@1.0.0-rc.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/streams@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))))(@typespec/rest@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/http@1.0.0-rc.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/streams@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))))))(@azure-tools/typespec-azure-resource-manager@0.54.0(sq74qt2k6r4fvjwy37msq4cl7a))(@azure-tools/typespec-client-generator-core@0.54.0(qizmnx62cykc7f5nejydwkmymm))(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))': + dependencies: + '@azure-tools/typespec-azure-core': 0.54.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/http@1.0.0-rc.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/streams@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))))(@typespec/rest@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/http@1.0.0-rc.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/streams@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))))) + '@azure-tools/typespec-azure-resource-manager': 0.54.0(sq74qt2k6r4fvjwy37msq4cl7a) + '@azure-tools/typespec-client-generator-core': 0.54.0(qizmnx62cykc7f5nejydwkmymm) + '@typespec/compiler': 1.0.0-rc.0(@types/node@22.13.17) + + '@azure-tools/typespec-client-generator-core@0.54.0(qizmnx62cykc7f5nejydwkmymm)': + dependencies: + '@azure-tools/typespec-azure-core': 0.54.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/http@1.0.0-rc.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/streams@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))))(@typespec/rest@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/http@1.0.0-rc.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/streams@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))))) + '@typespec/compiler': 1.0.0-rc.0(@types/node@22.13.17) + '@typespec/events': 0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17)) + '@typespec/http': 1.0.0-rc.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/streams@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))) + '@typespec/openapi': 1.0.0-rc.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/http@1.0.0-rc.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/streams@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17)))) + '@typespec/rest': 0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/http@1.0.0-rc.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/streams@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17)))) + '@typespec/sse': 0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/events@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17)))(@typespec/http@1.0.0-rc.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/streams@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))))(@typespec/streams@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))) + '@typespec/streams': 0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17)) + '@typespec/versioning': 0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17)) + '@typespec/xml': 0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17)) change-case: 5.4.4 pluralize: 8.0.0 yaml: 2.7.0 @@ -5842,25 +5868,48 @@ snapshots: transitivePeerDependencies: - '@types/node' - '@typespec/events@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))': + '@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17)': dependencies: - '@typespec/compiler': 0.68.0-dev.13(@types/node@22.13.17) + '@babel/code-frame': 7.26.2 + '@inquirer/prompts': 7.4.0(@types/node@22.13.17) + ajv: 8.17.1 + change-case: 5.4.4 + env-paths: 3.0.0 + globby: 14.1.0 + is-unicode-supported: 2.1.0 + mustache: 4.2.0 + picocolors: 1.1.1 + prettier: 3.5.3 + semver: 7.7.1 + tar: 7.4.3 + temporal-polyfill: 0.2.5 + vscode-languageserver: 9.0.1 + vscode-languageserver-textdocument: 1.0.12 + yaml: 2.7.0 + yargs: 17.7.2 + transitivePeerDependencies: + - '@types/node' - '@typespec/http-client-python@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcxNDA2NS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.8.2.tgz(7lctz6vgqeif7iqlya3bzwoexa)': - dependencies: - '@azure-tools/typespec-autorest': 0.54.0-dev.5(slqx2jlvr2rb5u5z3itjv7na4u) - '@azure-tools/typespec-azure-core': 0.54.0-dev.5(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))))(@typespec/rest@0.68.0-dev.4(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))))) - '@azure-tools/typespec-azure-resource-manager': 0.54.0-dev.4(qb3xdiittordn2dqsr2n6il7zy) - '@azure-tools/typespec-azure-rulesets': 0.54.0-dev.2(@azure-tools/typespec-azure-core@0.54.0-dev.5(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))))(@typespec/rest@0.68.0-dev.4(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))))))(@azure-tools/typespec-azure-resource-manager@0.54.0-dev.4(qb3xdiittordn2dqsr2n6il7zy))(@azure-tools/typespec-client-generator-core@0.54.0-dev.22(llvaf3qoefvnsvhamv54x3g4pe))(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)) - '@azure-tools/typespec-client-generator-core': 0.54.0-dev.22(llvaf3qoefvnsvhamv54x3g4pe) - '@typespec/compiler': 0.68.0-dev.13(@types/node@22.13.17) - '@typespec/events': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)) - '@typespec/http': 0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))) - '@typespec/openapi': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)))) - '@typespec/rest': 0.68.0-dev.4(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)))) - '@typespec/sse': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/events@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))) - '@typespec/streams': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)) - '@typespec/versioning': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)) + '@typespec/events@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))': + dependencies: + '@typespec/compiler': 1.0.0-rc.0(@types/node@22.13.17) + + '@typespec/http-client-python@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcxNzQ4OS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.9.0.tgz(2ivfmxvrftapo7cbuxsaae6yq4)': + dependencies: + '@azure-tools/typespec-autorest': 0.54.0(eijwshhpe4ydfv4uxokr3dajqe) + '@azure-tools/typespec-azure-core': 0.54.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/http@1.0.0-rc.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/streams@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))))(@typespec/rest@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/http@1.0.0-rc.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/streams@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))))) + '@azure-tools/typespec-azure-resource-manager': 0.54.0(sq74qt2k6r4fvjwy37msq4cl7a) + '@azure-tools/typespec-azure-rulesets': 0.54.0(@azure-tools/typespec-azure-core@0.54.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/http@1.0.0-rc.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/streams@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))))(@typespec/rest@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/http@1.0.0-rc.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/streams@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))))))(@azure-tools/typespec-azure-resource-manager@0.54.0(sq74qt2k6r4fvjwy37msq4cl7a))(@azure-tools/typespec-client-generator-core@0.54.0(qizmnx62cykc7f5nejydwkmymm))(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17)) + '@azure-tools/typespec-client-generator-core': 0.54.0(qizmnx62cykc7f5nejydwkmymm) + '@typespec/compiler': 1.0.0-rc.0(@types/node@22.13.17) + '@typespec/events': 0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17)) + '@typespec/http': 1.0.0-rc.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/streams@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))) + '@typespec/openapi': 1.0.0-rc.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/http@1.0.0-rc.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/streams@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17)))) + '@typespec/rest': 0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/http@1.0.0-rc.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/streams@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17)))) + '@typespec/sse': 0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/events@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17)))(@typespec/http@1.0.0-rc.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/streams@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))))(@typespec/streams@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))) + '@typespec/streams': 0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17)) + '@typespec/versioning': 0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17)) + '@typespec/xml': 0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17)) js-yaml: 4.1.0 marked: 15.0.7 pyodide: 0.26.2 @@ -5870,36 +5919,47 @@ snapshots: - bufferutil - utf-8-validate - '@typespec/http-specs@0.1.0-alpha.17-dev.2(@types/node@22.13.17)(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))))(@typespec/rest@0.68.0-dev.4(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)))))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)))(@typespec/versioning@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)))(@typespec/xml@0.59.0(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)))': + '@typespec/http-specs@0.1.0-alpha.17(@types/node@22.13.17)(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/http@1.0.0-rc.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/streams@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))))(@typespec/rest@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/http@1.0.0-rc.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/streams@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17)))))(@typespec/streams@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17)))(@typespec/versioning@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17)))(@typespec/xml@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17)))': dependencies: - '@typespec/compiler': 0.68.0-dev.13(@types/node@22.13.17) - '@typespec/http': 0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))) - '@typespec/rest': 0.68.0-dev.4(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)))) + '@typespec/compiler': 1.0.0-rc.0(@types/node@22.13.17) + '@typespec/http': 1.0.0-rc.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/streams@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))) + '@typespec/rest': 0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/http@1.0.0-rc.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/streams@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17)))) '@typespec/spec-api': 0.1.0-alpha.4-dev.0 - '@typespec/spector': 0.1.0-alpha.11-dev.2(@types/node@22.13.17)(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))) - '@typespec/versioning': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)) - '@typespec/xml': 0.59.0(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)) + '@typespec/spector': 0.1.0-alpha.11-dev.2(@types/node@22.13.17)(@typespec/streams@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))) + '@typespec/versioning': 0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17)) + '@typespec/xml': 0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17)) deep-equal: 2.2.3 transitivePeerDependencies: - '@types/node' - '@typespec/streams' - supports-color - '@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)))': + '@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17)))': dependencies: '@typespec/compiler': 0.68.0-dev.13(@types/node@22.13.17) optionalDependencies: - '@typespec/streams': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)) + '@typespec/streams': 0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17)) - '@typespec/openapi@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))))': + '@typespec/http@1.0.0-rc.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/streams@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17)))': dependencies: - '@typespec/compiler': 0.68.0-dev.13(@types/node@22.13.17) - '@typespec/http': 0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))) + '@typespec/compiler': 1.0.0-rc.0(@types/node@22.13.17) + optionalDependencies: + '@typespec/streams': 0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17)) + + '@typespec/openapi@1.0.0-rc.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/http@1.0.0-rc.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/streams@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))))': + dependencies: + '@typespec/compiler': 1.0.0-rc.0(@types/node@22.13.17) + '@typespec/http': 1.0.0-rc.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/streams@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))) + + '@typespec/rest@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/http@1.0.0-rc.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/streams@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))))': + dependencies: + '@typespec/compiler': 1.0.0-rc.0(@types/node@22.13.17) + '@typespec/http': 1.0.0-rc.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/streams@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))) - '@typespec/rest@0.68.0-dev.4(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))))': + '@typespec/rest@0.68.0-dev.4(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))))': dependencies: '@typespec/compiler': 0.68.0-dev.13(@types/node@22.13.17) - '@typespec/http': 0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))) + '@typespec/http': 0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))) '@typespec/spec-api@0.1.0-alpha.4-dev.0': dependencies: @@ -5917,13 +5977,13 @@ snapshots: transitivePeerDependencies: - supports-color - '@typespec/spector@0.1.0-alpha.11-dev.2(@types/node@22.13.17)(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)))': + '@typespec/spector@0.1.0-alpha.11-dev.2(@types/node@22.13.17)(@typespec/streams@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17)))': dependencies: '@azure/identity': 4.8.0 '@types/js-yaml': 4.0.9 '@typespec/compiler': 0.68.0-dev.13(@types/node@22.13.17) - '@typespec/http': 0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))) - '@typespec/rest': 0.68.0-dev.4(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)))) + '@typespec/http': 0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))) + '@typespec/rest': 0.68.0-dev.4(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17)))) '@typespec/spec-api': 0.1.0-alpha.4-dev.0 '@typespec/spec-coverage-sdk': 0.1.0-alpha.5-dev.0 '@typespec/versioning': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)) @@ -5945,24 +6005,28 @@ snapshots: - '@typespec/streams' - supports-color - '@typespec/sse@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/events@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)))(@typespec/http@0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)))': + '@typespec/sse@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/events@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17)))(@typespec/http@1.0.0-rc.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/streams@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))))(@typespec/streams@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17)))': dependencies: - '@typespec/compiler': 0.68.0-dev.13(@types/node@22.13.17) - '@typespec/events': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)) - '@typespec/http': 0.68.0-dev.9(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))(@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))) - '@typespec/streams': 0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17)) + '@typespec/compiler': 1.0.0-rc.0(@types/node@22.13.17) + '@typespec/events': 0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17)) + '@typespec/http': 1.0.0-rc.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/streams@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))) + '@typespec/streams': 0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17)) - '@typespec/streams@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))': + '@typespec/streams@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))': dependencies: - '@typespec/compiler': 0.68.0-dev.13(@types/node@22.13.17) + '@typespec/compiler': 1.0.0-rc.0(@types/node@22.13.17) + + '@typespec/versioning@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))': + dependencies: + '@typespec/compiler': 1.0.0-rc.0(@types/node@22.13.17) '@typespec/versioning@0.68.0-dev.3(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))': dependencies: '@typespec/compiler': 0.68.0-dev.13(@types/node@22.13.17) - '@typespec/xml@0.59.0(@typespec/compiler@0.68.0-dev.13(@types/node@22.13.17))': + '@typespec/xml@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))': dependencies: - '@typespec/compiler': 0.68.0-dev.13(@types/node@22.13.17) + '@typespec/compiler': 1.0.0-rc.0(@types/node@22.13.17) '@vitest/expect@3.0.8': dependencies: From f53aee6885fbdadf728315aaa6c16cc71a535e3b Mon Sep 17 00:00:00 2001 From: Yuchao Yan Date: Thu, 3 Apr 2025 03:15:04 +0000 Subject: [PATCH 15/19] fix regenerate --- .../typespec-python/scripts/eng/regenerate.ts | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/packages/typespec-python/scripts/eng/regenerate.ts b/packages/typespec-python/scripts/eng/regenerate.ts index f76a73ec02c..d1ec2d0c4f7 100644 --- a/packages/typespec-python/scripts/eng/regenerate.ts +++ b/packages/typespec-python/scripts/eng/regenerate.ts @@ -203,25 +203,6 @@ function getEmitterOption(spec: string, flavor: string): Record[ const key = relativeSpec.includes("resiliency/srv-driven/old.tsp") ? relativeSpec : dirname(relativeSpec); const emitter_options = EMITTER_OPTIONS[key] || (flavor === "azure" ? AZURE_EMITTER_OPTIONS[key] : [{}]) || [{}]; const result = Array.isArray(emitter_options) ? emitter_options : [emitter_options]; - - function updateOptions(options: Record): void { - if (options["package-name"] && options["enable-typespec-namespace"] === undefined) { - options["enable-typespec-namespace"] = "false"; - } - } - - if (flavor !== "azure") { - for (const options of result) { - if (Array.isArray(options)) { - for (const option of options) { - updateOptions(option); - } - } else { - updateOptions(options); - } - } - } - return result; } From 09a25d97ef8241bf05125dc0e47d44c846a6fb7f Mon Sep 17 00:00:00 2001 From: Yuchao Yan Date: Thu, 3 Apr 2025 03:45:36 +0000 Subject: [PATCH 16/19] update --- packages/typespec-python/src/lib.ts | 2 +- .../resiliency-srv-driven1/CHANGELOG.md | 5 + .../generated/resiliency-srv-driven1/LICENSE | 21 + .../resiliency-srv-driven1/MANIFEST.in | 7 + .../resiliency-srv-driven1/README.md | 43 + .../apiview-properties.json | 8 + .../dev_requirements.txt | 3 + .../generated_tests/conftest.py | 41 + .../test_resiliency_service_driven.py | 36 + .../test_resiliency_service_driven_async.py | 37 + .../generated_tests/testpreparer.py | 22 + .../generated_tests/testpreparer_async.py | 14 + .../resiliency/__init__.py | 1 + .../resiliency/srv/__init__.py | 1 + .../resiliency/srv/driven1/__init__.py | 26 + .../resiliency/srv/driven1/_client.py | 103 + .../resiliency/srv/driven1/_configuration.py | 53 + .../resiliency/srv/driven1/_model_base.py | 1230 ++++++++++ .../srv/driven1/_operations/__init__.py | 19 + .../srv/driven1/_operations/_operations.py | 228 ++ .../srv/driven1/_operations/_patch.py | 21 + .../resiliency/srv/driven1/_patch.py | 21 + .../resiliency/srv/driven1/_serialization.py | 2026 +++++++++++++++++ .../resiliency/srv/driven1/_vendor.py | 18 + .../resiliency/srv/driven1/_version.py | 3 + .../resiliency/srv/driven1/aio/__init__.py | 23 + .../resiliency/srv/driven1/aio/_client.py | 105 + .../srv/driven1/aio/_configuration.py | 53 + .../srv/driven1/aio/_operations/__init__.py | 19 + .../driven1/aio/_operations/_operations.py | 189 ++ .../srv/driven1/aio/_operations/_patch.py | 21 + .../resiliency/srv/driven1/aio/_patch.py | 21 + .../resiliency/srv/driven1/aio/_vendor.py | 18 + .../resiliency/srv/driven1/py.typed | 1 + .../generated/resiliency-srv-driven1/setup.py | 65 + .../resiliency-srv-driven2/CHANGELOG.md | 5 + .../generated/resiliency-srv-driven2/LICENSE | 21 + .../resiliency-srv-driven2/MANIFEST.in | 7 + .../resiliency-srv-driven2/README.md | 43 + .../apiview-properties.json | 9 + .../dev_requirements.txt | 3 + .../generated_tests/conftest.py | 41 + .../test_resiliency_service_driven.py | 45 + .../test_resiliency_service_driven_async.py | 46 + .../generated_tests/testpreparer.py | 22 + .../generated_tests/testpreparer_async.py | 14 + .../resiliency/__init__.py | 1 + .../resiliency/srv/__init__.py | 1 + .../resiliency/srv/driven2/__init__.py | 26 + .../resiliency/srv/driven2/_client.py | 120 + .../resiliency/srv/driven2/_configuration.py | 53 + .../resiliency/srv/driven2/_model_base.py | 1230 ++++++++++ .../srv/driven2/_operations/__init__.py | 19 + .../srv/driven2/_operations/_operations.py | 318 +++ .../srv/driven2/_operations/_patch.py | 21 + .../resiliency/srv/driven2/_patch.py | 21 + .../resiliency/srv/driven2/_serialization.py | 2026 +++++++++++++++++ .../resiliency/srv/driven2/_validation.py | 44 + .../resiliency/srv/driven2/_vendor.py | 18 + .../resiliency/srv/driven2/_version.py | 3 + .../resiliency/srv/driven2/aio/__init__.py | 23 + .../resiliency/srv/driven2/aio/_client.py | 122 + .../srv/driven2/aio/_configuration.py | 53 + .../srv/driven2/aio/_operations/__init__.py | 19 + .../driven2/aio/_operations/_operations.py | 261 +++ .../srv/driven2/aio/_operations/_patch.py | 21 + .../resiliency/srv/driven2/aio/_patch.py | 21 + .../resiliency/srv/driven2/aio/_vendor.py | 18 + .../resiliency/srv/driven2/py.typed | 1 + .../generated/resiliency-srv-driven2/setup.py | 65 + .../union/aio/operations/_operations.py | 100 +- .../typetest/union/models/_models.py | 108 +- .../typetest/union/operations/_operations.py | 100 +- 73 files changed, 9418 insertions(+), 155 deletions(-) create mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven1/CHANGELOG.md create mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven1/LICENSE create mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven1/MANIFEST.in create mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven1/README.md create mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven1/apiview-properties.json create mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven1/dev_requirements.txt create mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven1/generated_tests/conftest.py create mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven1/generated_tests/test_resiliency_service_driven.py create mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven1/generated_tests/test_resiliency_service_driven_async.py create mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven1/generated_tests/testpreparer.py create mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven1/generated_tests/testpreparer_async.py create mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_client.py create mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_configuration.py create mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_model_base.py create mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_serialization.py create mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_vendor.py create mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_version.py create mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/aio/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/aio/_client.py create mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/aio/_configuration.py create mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/aio/_operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/aio/_operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/aio/_operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/aio/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/aio/_vendor.py create mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/py.typed create mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven1/setup.py create mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven2/CHANGELOG.md create mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven2/LICENSE create mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven2/MANIFEST.in create mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven2/README.md create mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven2/apiview-properties.json create mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven2/dev_requirements.txt create mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven2/generated_tests/conftest.py create mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven2/generated_tests/test_resiliency_service_driven.py create mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven2/generated_tests/test_resiliency_service_driven_async.py create mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven2/generated_tests/testpreparer.py create mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven2/generated_tests/testpreparer_async.py create mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_client.py create mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_configuration.py create mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_model_base.py create mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_serialization.py create mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_validation.py create mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_vendor.py create mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_version.py create mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/aio/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/aio/_client.py create mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/aio/_configuration.py create mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/aio/_operations/__init__.py create mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/aio/_operations/_operations.py create mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/aio/_operations/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/aio/_patch.py create mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/aio/_vendor.py create mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/py.typed create mode 100644 packages/typespec-python/test/azure/generated/resiliency-srv-driven2/setup.py diff --git a/packages/typespec-python/src/lib.ts b/packages/typespec-python/src/lib.ts index 43352489d33..6e85d60424c 100644 --- a/packages/typespec-python/src/lib.ts +++ b/packages/typespec-python/src/lib.ts @@ -19,7 +19,7 @@ export interface PythonSdkContext const PythonAzureEmitterOptionsSchema: JSONSchemaType = { type: "object", - additionalProperties: false, + additionalProperties: true, properties: { ...BrandedSdkEmitterOptions["examples-dir"], ...BrandedSdkEmitterOptions["namespace"], diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/CHANGELOG.md b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/CHANGELOG.md new file mode 100644 index 00000000000..628743d283a --- /dev/null +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/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/resiliency-srv-driven1/LICENSE b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/LICENSE new file mode 100644 index 00000000000..63447fd8bbb --- /dev/null +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/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/resiliency-srv-driven1/MANIFEST.in b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/MANIFEST.in new file mode 100644 index 00000000000..0afda28e610 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/MANIFEST.in @@ -0,0 +1,7 @@ +include *.md +include LICENSE +include resiliency/srv/driven1/py.typed +recursive-include tests *.py +recursive-include samples *.py *.md +include resiliency/__init__.py +include resiliency/srv/__init__.py diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/README.md b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/README.md new file mode 100644 index 00000000000..74ce9cfcdee --- /dev/null +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/README.md @@ -0,0 +1,43 @@ +# ResiliencySrvDriven1 client library for Python + + +## Getting started + +### Install the package + +```bash +python -m pip install resiliency-srv-driven1 +``` + +#### 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 ResiliencySrvDriven1 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/resiliency-srv-driven1/apiview-properties.json b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/apiview-properties.json new file mode 100644 index 00000000000..cca76b075c5 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/apiview-properties.json @@ -0,0 +1,8 @@ +{ + "CrossLanguagePackageId": "Resiliency.ServiceDriven", + "CrossLanguageDefinitionId": { + "resiliency.srv.driven1.ResiliencyServiceDrivenClient.from_none": "Resiliency.ServiceDriven.AddOptionalParam.fromNone", + "resiliency.srv.driven1.ResiliencyServiceDrivenClient.from_one_required": "Resiliency.ServiceDriven.AddOptionalParam.fromOneRequired", + "resiliency.srv.driven1.ResiliencyServiceDrivenClient.from_one_optional": "Resiliency.ServiceDriven.AddOptionalParam.fromOneOptional" + } +} \ No newline at end of file diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/dev_requirements.txt b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/dev_requirements.txt new file mode 100644 index 00000000000..10548647144 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/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/resiliency-srv-driven1/generated_tests/conftest.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/generated_tests/conftest.py new file mode 100644 index 00000000000..a8b02f1c29e --- /dev/null +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/generated_tests/conftest.py @@ -0,0 +1,41 @@ +# coding=utf-8 +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() + + +# For security, please avoid record sensitive identity information in recordings +@pytest.fixture(scope="session", autouse=True) +def add_sanitizers(test_proxy): + resiliencyservicedriven_subscription_id = os.environ.get( + "RESILIENCYSERVICEDRIVEN_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000" + ) + resiliencyservicedriven_tenant_id = os.environ.get( + "RESILIENCYSERVICEDRIVEN_TENANT_ID", "00000000-0000-0000-0000-000000000000" + ) + resiliencyservicedriven_client_id = os.environ.get( + "RESILIENCYSERVICEDRIVEN_CLIENT_ID", "00000000-0000-0000-0000-000000000000" + ) + resiliencyservicedriven_client_secret = os.environ.get( + "RESILIENCYSERVICEDRIVEN_CLIENT_SECRET", "00000000-0000-0000-0000-000000000000" + ) + add_general_regex_sanitizer( + regex=resiliencyservicedriven_subscription_id, value="00000000-0000-0000-0000-000000000000" + ) + add_general_regex_sanitizer(regex=resiliencyservicedriven_tenant_id, value="00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=resiliencyservicedriven_client_id, value="00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer( + regex=resiliencyservicedriven_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/resiliency-srv-driven1/generated_tests/test_resiliency_service_driven.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/generated_tests/test_resiliency_service_driven.py new file mode 100644 index 00000000000..58499e1d169 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/generated_tests/test_resiliency_service_driven.py @@ -0,0 +1,36 @@ +# coding=utf-8 +import pytest +from devtools_testutils import recorded_by_proxy +from testpreparer import ResiliencyServiceDrivenClientTestBase, ResiliencyServiceDrivenPreparer + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestResiliencyServiceDriven(ResiliencyServiceDrivenClientTestBase): + @ResiliencyServiceDrivenPreparer() + @recorded_by_proxy + def test_from_none(self, resiliencyservicedriven_endpoint): + client = self.create_client(endpoint=resiliencyservicedriven_endpoint) + response = client.from_none() + + # please add some check logic here by yourself + # ... + + @ResiliencyServiceDrivenPreparer() + @recorded_by_proxy + def test_from_one_required(self, resiliencyservicedriven_endpoint): + client = self.create_client(endpoint=resiliencyservicedriven_endpoint) + response = client.from_one_required( + parameter="str", + ) + + # please add some check logic here by yourself + # ... + + @ResiliencyServiceDrivenPreparer() + @recorded_by_proxy + def test_from_one_optional(self, resiliencyservicedriven_endpoint): + client = self.create_client(endpoint=resiliencyservicedriven_endpoint) + response = client.from_one_optional() + + # please add some check logic here by yourself + # ... diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/generated_tests/test_resiliency_service_driven_async.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/generated_tests/test_resiliency_service_driven_async.py new file mode 100644 index 00000000000..1998fbcccdd --- /dev/null +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/generated_tests/test_resiliency_service_driven_async.py @@ -0,0 +1,37 @@ +# coding=utf-8 +import pytest +from devtools_testutils.aio import recorded_by_proxy_async +from testpreparer import ResiliencyServiceDrivenPreparer +from testpreparer_async import ResiliencyServiceDrivenClientTestBaseAsync + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestResiliencyServiceDrivenAsync(ResiliencyServiceDrivenClientTestBaseAsync): + @ResiliencyServiceDrivenPreparer() + @recorded_by_proxy_async + async def test_from_none(self, resiliencyservicedriven_endpoint): + client = self.create_async_client(endpoint=resiliencyservicedriven_endpoint) + response = await client.from_none() + + # please add some check logic here by yourself + # ... + + @ResiliencyServiceDrivenPreparer() + @recorded_by_proxy_async + async def test_from_one_required(self, resiliencyservicedriven_endpoint): + client = self.create_async_client(endpoint=resiliencyservicedriven_endpoint) + response = await client.from_one_required( + parameter="str", + ) + + # please add some check logic here by yourself + # ... + + @ResiliencyServiceDrivenPreparer() + @recorded_by_proxy_async + async def test_from_one_optional(self, resiliencyservicedriven_endpoint): + client = self.create_async_client(endpoint=resiliencyservicedriven_endpoint) + response = await client.from_one_optional() + + # please add some check logic here by yourself + # ... diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/generated_tests/testpreparer.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/generated_tests/testpreparer.py new file mode 100644 index 00000000000..6acb31d75c4 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/generated_tests/testpreparer.py @@ -0,0 +1,22 @@ +# coding=utf-8 +from devtools_testutils import AzureRecordedTestCase, PowerShellPreparer +import functools +from resiliency.srv.driven1 import ResiliencyServiceDrivenClient + + +class ResiliencyServiceDrivenClientTestBase(AzureRecordedTestCase): + + def create_client(self, endpoint): + credential = self.get_credential(ResiliencyServiceDrivenClient) + return self.create_client_from_credential( + ResiliencyServiceDrivenClient, + credential=credential, + endpoint=endpoint, + ) + + +ResiliencyServiceDrivenPreparer = functools.partial( + PowerShellPreparer, + "resiliencyservicedriven", + resiliencyservicedriven_endpoint="https://fake_resiliencyservicedriven_endpoint.com", +) diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/generated_tests/testpreparer_async.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/generated_tests/testpreparer_async.py new file mode 100644 index 00000000000..b3ac849dbfe --- /dev/null +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/generated_tests/testpreparer_async.py @@ -0,0 +1,14 @@ +# coding=utf-8 +from devtools_testutils import AzureRecordedTestCase +from resiliency.srv.driven1.aio import ResiliencyServiceDrivenClient + + +class ResiliencyServiceDrivenClientTestBaseAsync(AzureRecordedTestCase): + + def create_async_client(self, endpoint): + credential = self.get_credential(ResiliencyServiceDrivenClient, is_async=True) + return self.create_client_from_credential( + ResiliencyServiceDrivenClient, + credential=credential, + endpoint=endpoint, + ) diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/__init__.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/__init__.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/__init__.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/__init__.py new file mode 100644 index 00000000000..777f7bc99dd --- /dev/null +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/__init__.py @@ -0,0 +1,26 @@ +# coding=utf-8 +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._client import ResiliencyServiceDrivenClient # type: ignore +from ._version import VERSION + +__version__ = VERSION + +try: + from ._patch import __all__ as _patch_all + from ._patch import * +except ImportError: + _patch_all = [] +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "ResiliencyServiceDrivenClient", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore + +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_client.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_client.py new file mode 100644 index 00000000000..fa40a38818d --- /dev/null +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_client.py @@ -0,0 +1,103 @@ +# coding=utf-8 + +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 ResiliencyServiceDrivenClientConfiguration +from ._operations import ResiliencyServiceDrivenClientOperationsMixin +from ._serialization import Deserializer, Serializer + + +class ResiliencyServiceDrivenClient(ResiliencyServiceDrivenClientOperationsMixin): + """Test that we can grow up a service spec and service deployment into a multi-versioned service + with full client support. + + :param endpoint: Need to be set as '`http://localhost:3000 `_' in + client. Required. + :type endpoint: str + :param service_deployment_version: Pass in either 'v1' or 'v2'. This represents a version of + the service deployment in history. 'v1' is for the deployment when the service had only one api + version. 'v2' is for the deployment when the service had api-versions 'v1' and 'v2'. Required. + :type service_deployment_version: str + :keyword api_version: Pass in 'v1'. This represents the API version of the service. Will grow + up in the next deployment to be both 'v1' and 'v2'. Known values are "v1" and None. Default + value is "v1". Note that overriding this default value may result in unsupported behavior. + :paramtype api_version: str + """ + + def __init__( # pylint: disable=missing-client-constructor-parameter-credential + self, endpoint: str, service_deployment_version: str, **kwargs: Any + ) -> None: + _endpoint = ( + "{endpoint}/resiliency/service-driven/client:v1/service:{serviceDeploymentVersion}/api-version:{apiVersion}" + ) + self._config = ResiliencyServiceDrivenClientConfiguration( + endpoint=endpoint, service_deployment_version=service_deployment_version, **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 + + 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), + "serviceDeploymentVersion": self._serialize.url( + "self._config.service_deployment_version", self._config.service_deployment_version, "str" + ), + "apiVersion": self._serialize.url("self._config.api_version", self._config.api_version, "str"), + } + + 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/resiliency-srv-driven1/resiliency/srv/driven1/_configuration.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_configuration.py new file mode 100644 index 00000000000..3e5ae14d4e5 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_configuration.py @@ -0,0 +1,53 @@ +# coding=utf-8 + +from typing import Any + +from azure.core.pipeline import policies + +from ._version import VERSION + + +class ResiliencyServiceDrivenClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long + """Configuration for ResiliencyServiceDrivenClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param endpoint: Need to be set as '`http://localhost:3000 `_' in + client. Required. + :type endpoint: str + :param service_deployment_version: Pass in either 'v1' or 'v2'. This represents a version of + the service deployment in history. 'v1' is for the deployment when the service had only one api + version. 'v2' is for the deployment when the service had api-versions 'v1' and 'v2'. Required. + :type service_deployment_version: str + :keyword api_version: Pass in 'v1'. This represents the API version of the service. Will grow + up in the next deployment to be both 'v1' and 'v2'. Known values are "v1" and None. Default + value is "v1". Note that overriding this default value may result in unsupported behavior. + :paramtype api_version: str + """ + + def __init__(self, endpoint: str, service_deployment_version: str, **kwargs: Any) -> None: + api_version: str = kwargs.pop("api_version", "v1") + + if endpoint is None: + raise ValueError("Parameter 'endpoint' must not be None.") + if service_deployment_version is None: + raise ValueError("Parameter 'service_deployment_version' must not be None.") + + self.endpoint = endpoint + self.service_deployment_version = service_deployment_version + self.api_version = api_version + kwargs.setdefault("sdk_moniker", "resiliency-srv-driven1/{}".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/resiliency-srv-driven1/resiliency/srv/driven1/_model_base.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_model_base.py new file mode 100644 index 00000000000..e8ecb270bd8 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_model_base.py @@ -0,0 +1,1230 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# pylint: disable=protected-access, 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 +import xml.etree.ElementTree as ET +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"] + 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)) + + +def _deserialize_int_as_str(attr): + if isinstance(attr, int): + return attr + return int(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 annotation is int and rf and rf._format == "str": + return _deserialize_int_as_str + if rf and rf._format: + return _DESERIALIZE_MAPPING_WITHFORMAT.get(rf._format) + return _DESERIALIZE_MAPPING.get(annotation) # pyright: ignore + + +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]: + """ + :returns: a set-like object providing a view on D's keys + :rtype: ~typing.KeysView + """ + return self._data.keys() + + def values(self) -> typing.ValuesView[typing.Any]: + """ + :returns: an object providing a view on D's values + :rtype: ~typing.ValuesView + """ + return self._data.values() + + def items(self) -> typing.ItemsView[str, typing.Any]: + """ + :returns: set-like object providing a view on D's items + :rtype: ~typing.ItemsView + """ + return self._data.items() + + def get(self, key: str, default: typing.Any = None) -> typing.Any: + """ + Get the value for key if key is in the dictionary, else default. + :param str key: The key to look up. + :param any default: The value to return if key is not in the dictionary. Defaults to None + :returns: D[k] if k in D, else d. + :rtype: 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: + """ + Removes specified key and return the corresponding value. + :param str key: The key to pop. + :param any default: The value to return if key is not in the dictionary + :returns: The value corresponding to the key. + :rtype: any + :raises KeyError: If key is not found and default is not given. + """ + if default is _UNSET: + return self._data.pop(key) + return self._data.pop(key, default) + + def popitem(self) -> typing.Tuple[str, typing.Any]: + """ + Removes and returns some (key, value) pair + :returns: The (key, value) pair. + :rtype: tuple + :raises KeyError: if D is empty. + """ + return self._data.popitem() + + def clear(self) -> None: + """ + Remove all items from D. + """ + self._data.clear() + + def update(self, *args: typing.Any, **kwargs: typing.Any) -> None: + """ + Updates D from mapping/iterable E and F. + :param any args: Either a mapping object or an iterable of key-value pairs. + """ + 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: + """ + Same as calling D.get(k, d), and setting D[k]=d if k not found + :param str key: The key to look up. + :param any default: The value to set if key is not in the dictionary + :returns: D[k] if k in D, else d. + :rtype: 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) + if isinstance(value, ET.Element): + value = _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: # pylint: disable=too-many-nested-blocks + if isinstance(args[0], ET.Element): + existed_attr_keys = [] + model_meta = getattr(self, "_xml", {}) + + for rf in self._attr_to_rest_field.values(): + prop_meta = getattr(rf, "_xml", {}) + xml_name = prop_meta.get("name", rf._rest_name) + xml_ns = prop_meta.get("ns", model_meta.get("ns", None)) + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + + # attribute + if prop_meta.get("attribute", False) and args[0].get(xml_name) is not None: + existed_attr_keys.append(xml_name) + dict_to_pass[rf._rest_name] = _deserialize(rf._type, args[0].get(xml_name)) + continue + + # unwrapped element is array + if prop_meta.get("unwrapped", False): + # unwrapped array could either use prop items meta/prop meta + if prop_meta.get("itemsName"): + xml_name = prop_meta.get("itemsName") + xml_ns = prop_meta.get("itemNs") + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + items = args[0].findall(xml_name) # pyright: ignore + if len(items) > 0: + existed_attr_keys.append(xml_name) + dict_to_pass[rf._rest_name] = _deserialize(rf._type, items) + continue + + # text element is primitive type + if prop_meta.get("text", False): + if args[0].text is not None: + dict_to_pass[rf._rest_name] = _deserialize(rf._type, args[0].text) + continue + + # wrapped element could be normal property or array, it should only have one element + item = args[0].find(xml_name) + if item is not None: + existed_attr_keys.append(xml_name) + dict_to_pass[rf._rest_name] = _deserialize(rf._type, item) + + # rest thing is additional properties + for e in args[0]: + if e.tag not in existed_attr_keys: + dict_to_pass[e.tag] = _convert_element(e) + else: + 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: + 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__") + for k, v in mro_class.__annotations__.items() + } + 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__"): + base.__mapping__[discriminator or cls.__name__] = cls # type: ignore + + @classmethod + def _get_discriminator(cls, exist_discriminators) -> typing.Optional["_RestField"]: + for v in cls.__dict__.values(): + if isinstance(v, _RestField) and v._is_discriminator and v._rest_name not in exist_discriminators: + return v + return None + + @classmethod + def _deserialize(cls, data, exist_discriminators): + if not hasattr(cls, "__mapping__"): + return cls(data) + discriminator = cls._get_discriminator(exist_discriminators) + if discriminator is None: + return cls(data) + exist_discriminators.append(discriminator._rest_name) + if isinstance(data, ET.Element): + model_meta = getattr(cls, "_xml", {}) + prop_meta = getattr(discriminator, "_xml", {}) + xml_name = prop_meta.get("name", discriminator._rest_name) + xml_ns = prop_meta.get("ns", model_meta.get("ns", None)) + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + + if data.get(xml_name) is not None: + discriminator_value = data.get(xml_name) + else: + discriminator_value = data.find(xml_name).text # pyright: ignore + else: + discriminator_value = data.get(discriminator._rest_name) + mapped_cls = cls.__mapping__.get(discriminator_value, cls) # pyright: ignore + return mapped_cls._deserialize(data, exist_discriminators) + + def as_dict(self, *, exclude_readonly: bool = False) -> typing.Dict[str, typing.Any]: + """Return a dict that can be turned into json 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 + if isinstance(obj, ET.Element): + obj = {child.tag: child for child in 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 + if isinstance(obj, ET.Element): + obj = list(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=too-many-return-statements, too-many-branches + annotation: typing.Any, + module: typing.Optional[str], + rf: typing.Optional["_RestField"] = None, +) -> typing.Optional[typing.Callable[[typing.Any], typing.Any]]: + if not annotation: + 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) # type: ignore + + 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, +): # pylint: disable=too-many-return-statements + try: + if value is None or isinstance(value, _Null): + return None + if isinstance(value, ET.Element): + if deserializer is str: + return value.text or "" + if deserializer is int: + return int(value.text) if value.text else None + if deserializer is float: + return float(value.text) if value.text else None + if deserializer is bool: + return value.text == "true" if value.text else None + if deserializer is None: + return value + if deserializer in [int, float, bool]: + return deserializer(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) + + +def _failsafe_deserialize( + deserializer: typing.Any, + value: typing.Any, + module: typing.Optional[str] = None, + rf: typing.Optional["_RestField"] = None, + format: typing.Optional[str] = None, +) -> typing.Any: + try: + return _deserialize(deserializer, value, module, rf, format) + except DeserializationError: + _LOGGER.warning( + "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True + ) + return None + + +def _failsafe_deserialize_xml( + deserializer: typing.Any, + value: typing.Any, +) -> typing.Any: + try: + return _deserialize_xml(deserializer, value) + except DeserializationError: + _LOGGER.warning( + "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True + ) + return None + + +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, + xml: typing.Optional[typing.Dict[str, typing.Any]] = None, + ): + 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 + self._xml = xml if xml is not None else {} + + @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, + xml: typing.Optional[typing.Dict[str, typing.Any]] = None, +) -> typing.Any: + return _RestField( + name=name, + type=type, + visibility=visibility, + default=default, + format=format, + is_multipart_file_input=is_multipart_file_input, + xml=xml, + ) + + +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, + xml: typing.Optional[typing.Dict[str, typing.Any]] = None, +) -> typing.Any: + return _RestField(name=name, type=type, is_discriminator=True, visibility=visibility, xml=xml) + + +def serialize_xml(model: Model, exclude_readonly: bool = False) -> str: + """Serialize a model to XML. + + :param Model model: The model to serialize. + :param bool exclude_readonly: Whether to exclude readonly properties. + :returns: The XML representation of the model. + :rtype: str + """ + return ET.tostring(_get_element(model, exclude_readonly), encoding="unicode") # type: ignore + + +def _get_element( + o: typing.Any, + exclude_readonly: bool = False, + parent_meta: typing.Optional[typing.Dict[str, typing.Any]] = None, + wrapped_element: typing.Optional[ET.Element] = None, +) -> typing.Union[ET.Element, typing.List[ET.Element]]: + if _is_model(o): + model_meta = getattr(o, "_xml", {}) + + # if prop is a model, then use the prop element directly, else generate a wrapper of model + if wrapped_element is None: + wrapped_element = _create_xml_element( + model_meta.get("name", o.__class__.__name__), + model_meta.get("prefix"), + model_meta.get("ns"), + ) + + readonly_props = [] + if exclude_readonly: + readonly_props = [p._rest_name for p in o._attr_to_rest_field.values() if _is_readonly(p)] + + for k, v in o.items(): + # do not serialize readonly properties + if exclude_readonly and k in readonly_props: + continue + + prop_rest_field = _get_rest_field(o._attr_to_rest_field, k) + if prop_rest_field: + prop_meta = getattr(prop_rest_field, "_xml").copy() + # use the wire name as xml name if no specific name is set + if prop_meta.get("name") is None: + prop_meta["name"] = k + else: + # additional properties will not have rest field, use the wire name as xml name + prop_meta = {"name": k} + + # if no ns for prop, use model's + if prop_meta.get("ns") is None and model_meta.get("ns"): + prop_meta["ns"] = model_meta.get("ns") + prop_meta["prefix"] = model_meta.get("prefix") + + if prop_meta.get("unwrapped", False): + # unwrapped could only set on array + wrapped_element.extend(_get_element(v, exclude_readonly, prop_meta)) + elif prop_meta.get("text", False): + # text could only set on primitive type + wrapped_element.text = _get_primitive_type_value(v) + elif prop_meta.get("attribute", False): + xml_name = prop_meta.get("name", k) + if prop_meta.get("ns"): + ET.register_namespace(prop_meta.get("prefix"), prop_meta.get("ns")) # pyright: ignore + xml_name = "{" + prop_meta.get("ns") + "}" + xml_name # pyright: ignore + # attribute should be primitive type + wrapped_element.set(xml_name, _get_primitive_type_value(v)) + else: + # other wrapped prop element + wrapped_element.append(_get_wrapped_element(v, exclude_readonly, prop_meta)) + return wrapped_element + if isinstance(o, list): + return [_get_element(x, exclude_readonly, parent_meta) for x in o] # type: ignore + if isinstance(o, dict): + result = [] + for k, v in o.items(): + result.append( + _get_wrapped_element( + v, + exclude_readonly, + { + "name": k, + "ns": parent_meta.get("ns") if parent_meta else None, + "prefix": parent_meta.get("prefix") if parent_meta else None, + }, + ) + ) + return result + + # primitive case need to create element based on parent_meta + if parent_meta: + return _get_wrapped_element( + o, + exclude_readonly, + { + "name": parent_meta.get("itemsName", parent_meta.get("name")), + "prefix": parent_meta.get("itemsPrefix", parent_meta.get("prefix")), + "ns": parent_meta.get("itemsNs", parent_meta.get("ns")), + }, + ) + + raise ValueError("Could not serialize value into xml: " + o) + + +def _get_wrapped_element( + v: typing.Any, + exclude_readonly: bool, + meta: typing.Optional[typing.Dict[str, typing.Any]], +) -> ET.Element: + wrapped_element = _create_xml_element( + meta.get("name") if meta else None, meta.get("prefix") if meta else None, meta.get("ns") if meta else None + ) + if isinstance(v, (dict, list)): + wrapped_element.extend(_get_element(v, exclude_readonly, meta)) + elif _is_model(v): + _get_element(v, exclude_readonly, meta, wrapped_element) + else: + wrapped_element.text = _get_primitive_type_value(v) + return wrapped_element + + +def _get_primitive_type_value(v) -> str: + if v is True: + return "true" + if v is False: + return "false" + if isinstance(v, _Null): + return "" + return str(v) + + +def _create_xml_element(tag, prefix=None, ns=None): + if prefix and ns: + ET.register_namespace(prefix, ns) + if ns: + return ET.Element("{" + ns + "}" + tag) + return ET.Element(tag) + + +def _deserialize_xml( + deserializer: typing.Any, + value: str, +) -> typing.Any: + element = ET.fromstring(value) # nosec + return _deserialize(deserializer, element) + + +def _convert_element(e: ET.Element): + # dict case + if len(e.attrib) > 0 or len({child.tag for child in e}) > 1: + dict_result: typing.Dict[str, typing.Any] = {} + for child in e: + if dict_result.get(child.tag) is not None: + if isinstance(dict_result[child.tag], list): + dict_result[child.tag].append(_convert_element(child)) + else: + dict_result[child.tag] = [dict_result[child.tag], _convert_element(child)] + else: + dict_result[child.tag] = _convert_element(child) + dict_result.update(e.attrib) + return dict_result + # array case + if len(e) > 0: + array_result: typing.List[typing.Any] = [] + for child in e: + array_result.append(_convert_element(child)) + return array_result + # primitive case + return e.text diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_operations/__init__.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_operations/__init__.py new file mode 100644 index 00000000000..4a8ff7f9c39 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_operations/__init__.py @@ -0,0 +1,19 @@ +# coding=utf-8 +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import ResiliencyServiceDrivenClientOperationsMixin # type: ignore + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "ResiliencyServiceDrivenClientOperationsMixin", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_operations/_operations.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_operations/_operations.py new file mode 100644 index 00000000000..22876d36a34 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_operations/_operations.py @@ -0,0 +1,228 @@ +# coding=utf-8 +import sys +from typing import Any, Callable, Dict, Optional, 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 ResiliencyServiceDrivenClientMixinABC + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_resiliency_service_driven_from_none_request(**kwargs: Any) -> HttpRequest: # pylint: disable=name-too-long + # Construct URL + _url = "/add-optional-param/from-none" + + return HttpRequest(method="HEAD", url=_url, **kwargs) + + +def build_resiliency_service_driven_from_one_required_request( # pylint: disable=name-too-long + *, parameter: str, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + # Construct URL + _url = "/add-optional-param/from-one-required" + + # Construct parameters + _params["parameter"] = _SERIALIZER.query("parameter", parameter, "str") + + return HttpRequest(method="GET", url=_url, params=_params, **kwargs) + + +def build_resiliency_service_driven_from_one_optional_request( # pylint: disable=name-too-long + *, parameter: Optional[str] = None, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + # Construct URL + _url = "/add-optional-param/from-one-optional" + + # Construct parameters + if parameter is not None: + _params["parameter"] = _SERIALIZER.query("parameter", parameter, "str") + + return HttpRequest(method="GET", url=_url, params=_params, **kwargs) + + +class ResiliencyServiceDrivenClientOperationsMixin( # pylint: disable=name-too-long + ResiliencyServiceDrivenClientMixinABC +): + + @distributed_trace + def from_none(self, **kwargs: Any) -> bool: + """Test that currently accepts no parameters, will be updated in next spec to accept a new + optional parameter as well. + + :return: bool + :rtype: bool + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_resiliency_service_driven_from_none_request( + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "serviceDeploymentVersion": self._serialize.url( + "self._config.service_deployment_version", self._config.service_deployment_version, "str" + ), + "apiVersion": self._serialize.url("self._config.api_version", self._config.api_version, "str"), + } + _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 from_one_required( # pylint: disable=inconsistent-return-statements + self, *, parameter: str, **kwargs: Any + ) -> None: + """Test that currently accepts one required parameter, will be updated in next spec to accept a + new optional parameter as well. + + :keyword parameter: I am a required parameter. Required. + :paramtype parameter: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_resiliency_service_driven_from_one_required_request( + parameter=parameter, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "serviceDeploymentVersion": self._serialize.url( + "self._config.service_deployment_version", self._config.service_deployment_version, "str" + ), + "apiVersion": self._serialize.url("self._config.api_version", self._config.api_version, "str"), + } + _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 from_one_optional( # pylint: disable=inconsistent-return-statements + self, *, parameter: Optional[str] = None, **kwargs: Any + ) -> None: + """Test that currently accepts one optional parameter, will be updated in next spec to accept a + new optional parameter as well. + + :keyword parameter: I am an optional parameter. Default value is None. + :paramtype parameter: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_resiliency_service_driven_from_one_optional_request( + parameter=parameter, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "serviceDeploymentVersion": self._serialize.url( + "self._config.service_deployment_version", self._config.service_deployment_version, "str" + ), + "apiVersion": self._serialize.url("self._config.api_version", self._config.api_version, "str"), + } + _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/resiliency-srv-driven1/resiliency/srv/driven1/_operations/_patch.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_operations/_patch.py new file mode 100644 index 00000000000..8bcb627aa47 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_operations/_patch.py @@ -0,0 +1,21 @@ +# 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. +# -------------------------------------------------------------------------- +"""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/resiliency-srv-driven1/resiliency/srv/driven1/_patch.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_patch.py new file mode 100644 index 00000000000..8bcb627aa47 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_patch.py @@ -0,0 +1,21 @@ +# 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. +# -------------------------------------------------------------------------- +"""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/resiliency-srv-driven1/resiliency/srv/driven1/_serialization.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_serialization.py new file mode 100644 index 00000000000..f71dbc0833e --- /dev/null +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_serialization.py @@ -0,0 +1,2026 @@ +# pylint: disable=line-too-long,useless-suppression,too-many-lines +# coding=utf-8 + +# 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, + MutableMapping, + 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 typing_extensions import Self + +from azure.core.exceptions import DeserializationError, SerializationError +from azure.core.serialization import NULL as CoreNull + +_BOM = codecs.BOM_UTF8.decode(encoding="utf-8") + +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 + +TZ_UTC = datetime.timezone.utc + +_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, data: Any, content_type: Optional[str] = None) -> Self: + """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: Self + """ + deserializer = Deserializer(cls._infer_class_models()) + return deserializer(cls.__name__, data, content_type=content_type) # type: ignore + + @classmethod + def from_dict( + cls, + data: Any, + key_extractors: Optional[Callable[[str, Dict[str, Any], Any], Any]] = None, + content_type: Optional[str] = None, + ) -> Self: + """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: Self + """ + 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. + + :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.get(rest_api_response_key, None) or response.get(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: # 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) -> 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( + 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: + """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) -> 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() # pylint: disable=protected-access # type: ignore + if v.get("readonly") + ] + const = [ + k + for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore + if v.get("constant") + ] + 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 # type: ignore + 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=datetime.timezone(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/resiliency-srv-driven1/resiliency/srv/driven1/_vendor.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_vendor.py new file mode 100644 index 00000000000..a1f1bf8898a --- /dev/null +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_vendor.py @@ -0,0 +1,18 @@ +from abc import ABC +from typing import TYPE_CHECKING + +from ._configuration import ResiliencyServiceDrivenClientConfiguration + +if TYPE_CHECKING: + from azure.core import PipelineClient + + from ._serialization import Deserializer, Serializer + + +class ResiliencyServiceDrivenClientMixinABC(ABC): + """DO NOT use this class. It is for internal typing use only.""" + + _client: "PipelineClient" + _config: ResiliencyServiceDrivenClientConfiguration + _serialize: "Serializer" + _deserialize: "Deserializer" diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_version.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_version.py new file mode 100644 index 00000000000..9f6458b8cda --- /dev/null +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/_version.py @@ -0,0 +1,3 @@ +# coding=utf-8 + +VERSION = "1.0.0b1" diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/aio/__init__.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/aio/__init__.py new file mode 100644 index 00000000000..4f41aabeaa2 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/aio/__init__.py @@ -0,0 +1,23 @@ +# coding=utf-8 +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._client import ResiliencyServiceDrivenClient # type: ignore + +try: + from ._patch import __all__ as _patch_all + from ._patch import * +except ImportError: + _patch_all = [] +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "ResiliencyServiceDrivenClient", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore + +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/aio/_client.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/aio/_client.py new file mode 100644 index 00000000000..6e5d7d32e1a --- /dev/null +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/aio/_client.py @@ -0,0 +1,105 @@ +# coding=utf-8 + +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 ResiliencyServiceDrivenClientConfiguration +from ._operations import ResiliencyServiceDrivenClientOperationsMixin + + +class ResiliencyServiceDrivenClient(ResiliencyServiceDrivenClientOperationsMixin): + """Test that we can grow up a service spec and service deployment into a multi-versioned service + with full client support. + + :param endpoint: Need to be set as '`http://localhost:3000 `_' in + client. Required. + :type endpoint: str + :param service_deployment_version: Pass in either 'v1' or 'v2'. This represents a version of + the service deployment in history. 'v1' is for the deployment when the service had only one api + version. 'v2' is for the deployment when the service had api-versions 'v1' and 'v2'. Required. + :type service_deployment_version: str + :keyword api_version: Pass in 'v1'. This represents the API version of the service. Will grow + up in the next deployment to be both 'v1' and 'v2'. Known values are "v1" and None. Default + value is "v1". Note that overriding this default value may result in unsupported behavior. + :paramtype api_version: str + """ + + def __init__( # pylint: disable=missing-client-constructor-parameter-credential + self, endpoint: str, service_deployment_version: str, **kwargs: Any + ) -> None: + _endpoint = ( + "{endpoint}/resiliency/service-driven/client:v1/service:{serviceDeploymentVersion}/api-version:{apiVersion}" + ) + self._config = ResiliencyServiceDrivenClientConfiguration( + endpoint=endpoint, service_deployment_version=service_deployment_version, **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 + + 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), + "serviceDeploymentVersion": self._serialize.url( + "self._config.service_deployment_version", self._config.service_deployment_version, "str" + ), + "apiVersion": self._serialize.url("self._config.api_version", self._config.api_version, "str"), + } + + 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/resiliency-srv-driven1/resiliency/srv/driven1/aio/_configuration.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/aio/_configuration.py new file mode 100644 index 00000000000..bce1e6a0cfc --- /dev/null +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/aio/_configuration.py @@ -0,0 +1,53 @@ +# coding=utf-8 + +from typing import Any + +from azure.core.pipeline import policies + +from .._version import VERSION + + +class ResiliencyServiceDrivenClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long + """Configuration for ResiliencyServiceDrivenClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param endpoint: Need to be set as '`http://localhost:3000 `_' in + client. Required. + :type endpoint: str + :param service_deployment_version: Pass in either 'v1' or 'v2'. This represents a version of + the service deployment in history. 'v1' is for the deployment when the service had only one api + version. 'v2' is for the deployment when the service had api-versions 'v1' and 'v2'. Required. + :type service_deployment_version: str + :keyword api_version: Pass in 'v1'. This represents the API version of the service. Will grow + up in the next deployment to be both 'v1' and 'v2'. Known values are "v1" and None. Default + value is "v1". Note that overriding this default value may result in unsupported behavior. + :paramtype api_version: str + """ + + def __init__(self, endpoint: str, service_deployment_version: str, **kwargs: Any) -> None: + api_version: str = kwargs.pop("api_version", "v1") + + if endpoint is None: + raise ValueError("Parameter 'endpoint' must not be None.") + if service_deployment_version is None: + raise ValueError("Parameter 'service_deployment_version' must not be None.") + + self.endpoint = endpoint + self.service_deployment_version = service_deployment_version + self.api_version = api_version + kwargs.setdefault("sdk_moniker", "resiliency-srv-driven1/{}".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/resiliency-srv-driven1/resiliency/srv/driven1/aio/_operations/__init__.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/aio/_operations/__init__.py new file mode 100644 index 00000000000..4a8ff7f9c39 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/aio/_operations/__init__.py @@ -0,0 +1,19 @@ +# coding=utf-8 +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import ResiliencyServiceDrivenClientOperationsMixin # type: ignore + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "ResiliencyServiceDrivenClientOperationsMixin", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/aio/_operations/_operations.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/aio/_operations/_operations.py new file mode 100644 index 00000000000..b73e81158c7 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/aio/_operations/_operations.py @@ -0,0 +1,189 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +import sys +from typing import Any, Callable, Dict, Optional, 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_resiliency_service_driven_from_none_request, + build_resiliency_service_driven_from_one_optional_request, + build_resiliency_service_driven_from_one_required_request, +) +from .._vendor import ResiliencyServiceDrivenClientMixinABC + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class ResiliencyServiceDrivenClientOperationsMixin( # pylint: disable=name-too-long + ResiliencyServiceDrivenClientMixinABC +): + + @distributed_trace_async + async def from_none(self, **kwargs: Any) -> bool: + """Test that currently accepts no parameters, will be updated in next spec to accept a new + optional parameter as well. + + :return: bool + :rtype: bool + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_resiliency_service_driven_from_none_request( + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "serviceDeploymentVersion": self._serialize.url( + "self._config.service_deployment_version", self._config.service_deployment_version, "str" + ), + "apiVersion": self._serialize.url("self._config.api_version", self._config.api_version, "str"), + } + _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 from_one_required(self, *, parameter: str, **kwargs: Any) -> None: + """Test that currently accepts one required parameter, will be updated in next spec to accept a + new optional parameter as well. + + :keyword parameter: I am a required parameter. Required. + :paramtype parameter: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_resiliency_service_driven_from_one_required_request( + parameter=parameter, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "serviceDeploymentVersion": self._serialize.url( + "self._config.service_deployment_version", self._config.service_deployment_version, "str" + ), + "apiVersion": self._serialize.url("self._config.api_version", self._config.api_version, "str"), + } + _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 + + @distributed_trace_async + async def from_one_optional(self, *, parameter: Optional[str] = None, **kwargs: Any) -> None: + """Test that currently accepts one optional parameter, will be updated in next spec to accept a + new optional parameter as well. + + :keyword parameter: I am an optional parameter. Default value is None. + :paramtype parameter: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_resiliency_service_driven_from_one_optional_request( + parameter=parameter, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "serviceDeploymentVersion": self._serialize.url( + "self._config.service_deployment_version", self._config.service_deployment_version, "str" + ), + "apiVersion": self._serialize.url("self._config.api_version", self._config.api_version, "str"), + } + _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/resiliency-srv-driven1/resiliency/srv/driven1/aio/_operations/_patch.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/aio/_operations/_patch.py new file mode 100644 index 00000000000..8bcb627aa47 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/aio/_operations/_patch.py @@ -0,0 +1,21 @@ +# 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. +# -------------------------------------------------------------------------- +"""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/resiliency-srv-driven1/resiliency/srv/driven1/aio/_patch.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/aio/_patch.py new file mode 100644 index 00000000000..8bcb627aa47 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/aio/_patch.py @@ -0,0 +1,21 @@ +# 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. +# -------------------------------------------------------------------------- +"""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/resiliency-srv-driven1/resiliency/srv/driven1/aio/_vendor.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/aio/_vendor.py new file mode 100644 index 00000000000..a683c047d98 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/aio/_vendor.py @@ -0,0 +1,18 @@ +from abc import ABC +from typing import TYPE_CHECKING + +from ._configuration import ResiliencyServiceDrivenClientConfiguration + +if TYPE_CHECKING: + from azure.core import AsyncPipelineClient + + from .._serialization import Deserializer, Serializer + + +class ResiliencyServiceDrivenClientMixinABC(ABC): + """DO NOT use this class. It is for internal typing use only.""" + + _client: "AsyncPipelineClient" + _config: ResiliencyServiceDrivenClientConfiguration + _serialize: "Serializer" + _deserialize: "Deserializer" diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/py.typed b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/py.typed new file mode 100644 index 00000000000..e5aff4f83af --- /dev/null +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/resiliency/srv/driven1/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/resiliency-srv-driven1/setup.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/setup.py new file mode 100644 index 00000000000..00cdce19581 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven1/setup.py @@ -0,0 +1,65 @@ +# coding=utf-8 + + +import os +import re +from setuptools import setup, find_packages + + +PACKAGE_NAME = "resiliency-srv-driven1" +PACKAGE_PPRINT_NAME = "ResiliencySrvDriven1" + +# 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 Corporation {} 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", + # Exclude packages that will be covered by PEP420 or nspkg + "resiliency", + "resiliency.srv", + ] + ), + include_package_data=True, + package_data={ + "resiliency.srv.driven1": ["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/resiliency-srv-driven2/CHANGELOG.md b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/CHANGELOG.md new file mode 100644 index 00000000000..628743d283a --- /dev/null +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/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/resiliency-srv-driven2/LICENSE b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/LICENSE new file mode 100644 index 00000000000..63447fd8bbb --- /dev/null +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/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/resiliency-srv-driven2/MANIFEST.in b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/MANIFEST.in new file mode 100644 index 00000000000..22e737be264 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/MANIFEST.in @@ -0,0 +1,7 @@ +include *.md +include LICENSE +include resiliency/srv/driven2/py.typed +recursive-include tests *.py +recursive-include samples *.py *.md +include resiliency/__init__.py +include resiliency/srv/__init__.py diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/README.md b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/README.md new file mode 100644 index 00000000000..18f39c6183d --- /dev/null +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/README.md @@ -0,0 +1,43 @@ +# ResiliencySrvDriven2 client library for Python + + +## Getting started + +### Install the package + +```bash +python -m pip install resiliency-srv-driven2 +``` + +#### 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 ResiliencySrvDriven2 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/resiliency-srv-driven2/apiview-properties.json b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/apiview-properties.json new file mode 100644 index 00000000000..f1c922a67a2 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/apiview-properties.json @@ -0,0 +1,9 @@ +{ + "CrossLanguagePackageId": "Resiliency.ServiceDriven", + "CrossLanguageDefinitionId": { + "resiliency.srv.driven2.ResiliencyServiceDrivenClient.add_operation": "Resiliency.ServiceDriven.addOperation", + "resiliency.srv.driven2.ResiliencyServiceDrivenClient.from_none": "Resiliency.ServiceDriven.AddOptionalParam.fromNone", + "resiliency.srv.driven2.ResiliencyServiceDrivenClient.from_one_required": "Resiliency.ServiceDriven.AddOptionalParam.fromOneRequired", + "resiliency.srv.driven2.ResiliencyServiceDrivenClient.from_one_optional": "Resiliency.ServiceDriven.AddOptionalParam.fromOneOptional" + } +} \ No newline at end of file diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/dev_requirements.txt b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/dev_requirements.txt new file mode 100644 index 00000000000..10548647144 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/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/resiliency-srv-driven2/generated_tests/conftest.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/generated_tests/conftest.py new file mode 100644 index 00000000000..a8b02f1c29e --- /dev/null +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/generated_tests/conftest.py @@ -0,0 +1,41 @@ +# coding=utf-8 +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() + + +# For security, please avoid record sensitive identity information in recordings +@pytest.fixture(scope="session", autouse=True) +def add_sanitizers(test_proxy): + resiliencyservicedriven_subscription_id = os.environ.get( + "RESILIENCYSERVICEDRIVEN_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000" + ) + resiliencyservicedriven_tenant_id = os.environ.get( + "RESILIENCYSERVICEDRIVEN_TENANT_ID", "00000000-0000-0000-0000-000000000000" + ) + resiliencyservicedriven_client_id = os.environ.get( + "RESILIENCYSERVICEDRIVEN_CLIENT_ID", "00000000-0000-0000-0000-000000000000" + ) + resiliencyservicedriven_client_secret = os.environ.get( + "RESILIENCYSERVICEDRIVEN_CLIENT_SECRET", "00000000-0000-0000-0000-000000000000" + ) + add_general_regex_sanitizer( + regex=resiliencyservicedriven_subscription_id, value="00000000-0000-0000-0000-000000000000" + ) + add_general_regex_sanitizer(regex=resiliencyservicedriven_tenant_id, value="00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=resiliencyservicedriven_client_id, value="00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer( + regex=resiliencyservicedriven_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/resiliency-srv-driven2/generated_tests/test_resiliency_service_driven.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/generated_tests/test_resiliency_service_driven.py new file mode 100644 index 00000000000..69fac02b913 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/generated_tests/test_resiliency_service_driven.py @@ -0,0 +1,45 @@ +# coding=utf-8 +import pytest +from devtools_testutils import recorded_by_proxy +from testpreparer import ResiliencyServiceDrivenClientTestBase, ResiliencyServiceDrivenPreparer + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestResiliencyServiceDriven(ResiliencyServiceDrivenClientTestBase): + @ResiliencyServiceDrivenPreparer() + @recorded_by_proxy + def test_add_operation(self, resiliencyservicedriven_endpoint): + client = self.create_client(endpoint=resiliencyservicedriven_endpoint) + response = client.add_operation() + + # please add some check logic here by yourself + # ... + + @ResiliencyServiceDrivenPreparer() + @recorded_by_proxy + def test_from_none(self, resiliencyservicedriven_endpoint): + client = self.create_client(endpoint=resiliencyservicedriven_endpoint) + response = client.from_none() + + # please add some check logic here by yourself + # ... + + @ResiliencyServiceDrivenPreparer() + @recorded_by_proxy + def test_from_one_required(self, resiliencyservicedriven_endpoint): + client = self.create_client(endpoint=resiliencyservicedriven_endpoint) + response = client.from_one_required( + parameter="str", + ) + + # please add some check logic here by yourself + # ... + + @ResiliencyServiceDrivenPreparer() + @recorded_by_proxy + def test_from_one_optional(self, resiliencyservicedriven_endpoint): + client = self.create_client(endpoint=resiliencyservicedriven_endpoint) + response = client.from_one_optional() + + # please add some check logic here by yourself + # ... diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/generated_tests/test_resiliency_service_driven_async.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/generated_tests/test_resiliency_service_driven_async.py new file mode 100644 index 00000000000..3428f5f7036 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/generated_tests/test_resiliency_service_driven_async.py @@ -0,0 +1,46 @@ +# coding=utf-8 +import pytest +from devtools_testutils.aio import recorded_by_proxy_async +from testpreparer import ResiliencyServiceDrivenPreparer +from testpreparer_async import ResiliencyServiceDrivenClientTestBaseAsync + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestResiliencyServiceDrivenAsync(ResiliencyServiceDrivenClientTestBaseAsync): + @ResiliencyServiceDrivenPreparer() + @recorded_by_proxy_async + async def test_add_operation(self, resiliencyservicedriven_endpoint): + client = self.create_async_client(endpoint=resiliencyservicedriven_endpoint) + response = await client.add_operation() + + # please add some check logic here by yourself + # ... + + @ResiliencyServiceDrivenPreparer() + @recorded_by_proxy_async + async def test_from_none(self, resiliencyservicedriven_endpoint): + client = self.create_async_client(endpoint=resiliencyservicedriven_endpoint) + response = await client.from_none() + + # please add some check logic here by yourself + # ... + + @ResiliencyServiceDrivenPreparer() + @recorded_by_proxy_async + async def test_from_one_required(self, resiliencyservicedriven_endpoint): + client = self.create_async_client(endpoint=resiliencyservicedriven_endpoint) + response = await client.from_one_required( + parameter="str", + ) + + # please add some check logic here by yourself + # ... + + @ResiliencyServiceDrivenPreparer() + @recorded_by_proxy_async + async def test_from_one_optional(self, resiliencyservicedriven_endpoint): + client = self.create_async_client(endpoint=resiliencyservicedriven_endpoint) + response = await client.from_one_optional() + + # please add some check logic here by yourself + # ... diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/generated_tests/testpreparer.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/generated_tests/testpreparer.py new file mode 100644 index 00000000000..4b27b01cbbd --- /dev/null +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/generated_tests/testpreparer.py @@ -0,0 +1,22 @@ +# coding=utf-8 +from devtools_testutils import AzureRecordedTestCase, PowerShellPreparer +import functools +from resiliency.srv.driven2 import ResiliencyServiceDrivenClient + + +class ResiliencyServiceDrivenClientTestBase(AzureRecordedTestCase): + + def create_client(self, endpoint): + credential = self.get_credential(ResiliencyServiceDrivenClient) + return self.create_client_from_credential( + ResiliencyServiceDrivenClient, + credential=credential, + endpoint=endpoint, + ) + + +ResiliencyServiceDrivenPreparer = functools.partial( + PowerShellPreparer, + "resiliencyservicedriven", + resiliencyservicedriven_endpoint="https://fake_resiliencyservicedriven_endpoint.com", +) diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/generated_tests/testpreparer_async.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/generated_tests/testpreparer_async.py new file mode 100644 index 00000000000..8d5fdf72038 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/generated_tests/testpreparer_async.py @@ -0,0 +1,14 @@ +# coding=utf-8 +from devtools_testutils import AzureRecordedTestCase +from resiliency.srv.driven2.aio import ResiliencyServiceDrivenClient + + +class ResiliencyServiceDrivenClientTestBaseAsync(AzureRecordedTestCase): + + def create_async_client(self, endpoint): + credential = self.get_credential(ResiliencyServiceDrivenClient, is_async=True) + return self.create_client_from_credential( + ResiliencyServiceDrivenClient, + credential=credential, + endpoint=endpoint, + ) diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/__init__.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/__init__.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/__init__.py new file mode 100644 index 00000000000..d55ccad1f57 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/__init__.py @@ -0,0 +1 @@ +__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/__init__.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/__init__.py new file mode 100644 index 00000000000..777f7bc99dd --- /dev/null +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/__init__.py @@ -0,0 +1,26 @@ +# coding=utf-8 +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._client import ResiliencyServiceDrivenClient # type: ignore +from ._version import VERSION + +__version__ = VERSION + +try: + from ._patch import __all__ as _patch_all + from ._patch import * +except ImportError: + _patch_all = [] +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "ResiliencyServiceDrivenClient", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore + +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_client.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_client.py new file mode 100644 index 00000000000..7000678cf9f --- /dev/null +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_client.py @@ -0,0 +1,120 @@ +# coding=utf-8 + +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 ResiliencyServiceDrivenClientConfiguration +from ._operations import ResiliencyServiceDrivenClientOperationsMixin +from ._serialization import Deserializer, Serializer + + +class ResiliencyServiceDrivenClient(ResiliencyServiceDrivenClientOperationsMixin): + """Test that we can grow up a service spec and service deployment into a multi-versioned service + with full client support. + + There are three concepts that should be clarified: + + 1. Client spec version: refers to the spec that the client is generated from. 'v1' is a client + generated from old.tsp and 'v2' is a client generated from main.tsp. + 2. Service deployment version: refers to a deployment version of the service. 'v1' represents + the initial deployment of the service with a single api version. 'v2' represents the new + deployment of a service with multiple api versions + 3. Api version: The initial deployment of the service only supports api version 'v1'. The new + deployment of the service supports api versions 'v1' and 'v2'. + + We test the following configurations from this service spec: + + * A client generated from the second service spec can call the second deployment of a service + with api version v1 + * A client generated from the second service spec can call the second deployment of a service + with api version v2. + + :param endpoint: Need to be set as '`http://localhost:3000 `_' in + client. Required. + :type endpoint: str + :param service_deployment_version: Pass in either 'v1' or 'v2'. This represents a version of + the service deployment in history. 'v1' is for the deployment when the service had only one api + version. 'v2' is for the deployment when the service had api-versions 'v1' and 'v2'. Required. + :type service_deployment_version: str + :keyword api_version: Pass in either 'v1' or 'v2'. This represents the API version of a + service. Known values are "v2" and None. Default value is "v2". Note that overriding this + default value may result in unsupported behavior. + :paramtype api_version: str + """ + + def __init__( # pylint: disable=missing-client-constructor-parameter-credential + self, endpoint: str, service_deployment_version: str, **kwargs: Any + ) -> None: + _endpoint = ( + "{endpoint}/resiliency/service-driven/client:v2/service:{serviceDeploymentVersion}/api-version:{apiVersion}" + ) + self._config = ResiliencyServiceDrivenClientConfiguration( + endpoint=endpoint, service_deployment_version=service_deployment_version, **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 + + 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), + "serviceDeploymentVersion": self._serialize.url( + "self._config.service_deployment_version", self._config.service_deployment_version, "str" + ), + "apiVersion": self._serialize.url("self._config.api_version", self._config.api_version, "str"), + } + + 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/resiliency-srv-driven2/resiliency/srv/driven2/_configuration.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_configuration.py new file mode 100644 index 00000000000..cf1da010fe0 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_configuration.py @@ -0,0 +1,53 @@ +# coding=utf-8 + +from typing import Any + +from azure.core.pipeline import policies + +from ._version import VERSION + + +class ResiliencyServiceDrivenClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long + """Configuration for ResiliencyServiceDrivenClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param endpoint: Need to be set as '`http://localhost:3000 `_' in + client. Required. + :type endpoint: str + :param service_deployment_version: Pass in either 'v1' or 'v2'. This represents a version of + the service deployment in history. 'v1' is for the deployment when the service had only one api + version. 'v2' is for the deployment when the service had api-versions 'v1' and 'v2'. Required. + :type service_deployment_version: str + :keyword api_version: Pass in either 'v1' or 'v2'. This represents the API version of a + service. Known values are "v2" and None. Default value is "v2". Note that overriding this + default value may result in unsupported behavior. + :paramtype api_version: str + """ + + def __init__(self, endpoint: str, service_deployment_version: str, **kwargs: Any) -> None: + api_version: str = kwargs.pop("api_version", "v2") + + if endpoint is None: + raise ValueError("Parameter 'endpoint' must not be None.") + if service_deployment_version is None: + raise ValueError("Parameter 'service_deployment_version' must not be None.") + + self.endpoint = endpoint + self.service_deployment_version = service_deployment_version + self.api_version = api_version + kwargs.setdefault("sdk_moniker", "resiliency-srv-driven2/{}".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/resiliency-srv-driven2/resiliency/srv/driven2/_model_base.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_model_base.py new file mode 100644 index 00000000000..e8ecb270bd8 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_model_base.py @@ -0,0 +1,1230 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# pylint: disable=protected-access, 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 +import xml.etree.ElementTree as ET +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"] + 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)) + + +def _deserialize_int_as_str(attr): + if isinstance(attr, int): + return attr + return int(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 annotation is int and rf and rf._format == "str": + return _deserialize_int_as_str + if rf and rf._format: + return _DESERIALIZE_MAPPING_WITHFORMAT.get(rf._format) + return _DESERIALIZE_MAPPING.get(annotation) # pyright: ignore + + +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]: + """ + :returns: a set-like object providing a view on D's keys + :rtype: ~typing.KeysView + """ + return self._data.keys() + + def values(self) -> typing.ValuesView[typing.Any]: + """ + :returns: an object providing a view on D's values + :rtype: ~typing.ValuesView + """ + return self._data.values() + + def items(self) -> typing.ItemsView[str, typing.Any]: + """ + :returns: set-like object providing a view on D's items + :rtype: ~typing.ItemsView + """ + return self._data.items() + + def get(self, key: str, default: typing.Any = None) -> typing.Any: + """ + Get the value for key if key is in the dictionary, else default. + :param str key: The key to look up. + :param any default: The value to return if key is not in the dictionary. Defaults to None + :returns: D[k] if k in D, else d. + :rtype: 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: + """ + Removes specified key and return the corresponding value. + :param str key: The key to pop. + :param any default: The value to return if key is not in the dictionary + :returns: The value corresponding to the key. + :rtype: any + :raises KeyError: If key is not found and default is not given. + """ + if default is _UNSET: + return self._data.pop(key) + return self._data.pop(key, default) + + def popitem(self) -> typing.Tuple[str, typing.Any]: + """ + Removes and returns some (key, value) pair + :returns: The (key, value) pair. + :rtype: tuple + :raises KeyError: if D is empty. + """ + return self._data.popitem() + + def clear(self) -> None: + """ + Remove all items from D. + """ + self._data.clear() + + def update(self, *args: typing.Any, **kwargs: typing.Any) -> None: + """ + Updates D from mapping/iterable E and F. + :param any args: Either a mapping object or an iterable of key-value pairs. + """ + 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: + """ + Same as calling D.get(k, d), and setting D[k]=d if k not found + :param str key: The key to look up. + :param any default: The value to set if key is not in the dictionary + :returns: D[k] if k in D, else d. + :rtype: 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) + if isinstance(value, ET.Element): + value = _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: # pylint: disable=too-many-nested-blocks + if isinstance(args[0], ET.Element): + existed_attr_keys = [] + model_meta = getattr(self, "_xml", {}) + + for rf in self._attr_to_rest_field.values(): + prop_meta = getattr(rf, "_xml", {}) + xml_name = prop_meta.get("name", rf._rest_name) + xml_ns = prop_meta.get("ns", model_meta.get("ns", None)) + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + + # attribute + if prop_meta.get("attribute", False) and args[0].get(xml_name) is not None: + existed_attr_keys.append(xml_name) + dict_to_pass[rf._rest_name] = _deserialize(rf._type, args[0].get(xml_name)) + continue + + # unwrapped element is array + if prop_meta.get("unwrapped", False): + # unwrapped array could either use prop items meta/prop meta + if prop_meta.get("itemsName"): + xml_name = prop_meta.get("itemsName") + xml_ns = prop_meta.get("itemNs") + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + items = args[0].findall(xml_name) # pyright: ignore + if len(items) > 0: + existed_attr_keys.append(xml_name) + dict_to_pass[rf._rest_name] = _deserialize(rf._type, items) + continue + + # text element is primitive type + if prop_meta.get("text", False): + if args[0].text is not None: + dict_to_pass[rf._rest_name] = _deserialize(rf._type, args[0].text) + continue + + # wrapped element could be normal property or array, it should only have one element + item = args[0].find(xml_name) + if item is not None: + existed_attr_keys.append(xml_name) + dict_to_pass[rf._rest_name] = _deserialize(rf._type, item) + + # rest thing is additional properties + for e in args[0]: + if e.tag not in existed_attr_keys: + dict_to_pass[e.tag] = _convert_element(e) + else: + 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: + 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__") + for k, v in mro_class.__annotations__.items() + } + 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__"): + base.__mapping__[discriminator or cls.__name__] = cls # type: ignore + + @classmethod + def _get_discriminator(cls, exist_discriminators) -> typing.Optional["_RestField"]: + for v in cls.__dict__.values(): + if isinstance(v, _RestField) and v._is_discriminator and v._rest_name not in exist_discriminators: + return v + return None + + @classmethod + def _deserialize(cls, data, exist_discriminators): + if not hasattr(cls, "__mapping__"): + return cls(data) + discriminator = cls._get_discriminator(exist_discriminators) + if discriminator is None: + return cls(data) + exist_discriminators.append(discriminator._rest_name) + if isinstance(data, ET.Element): + model_meta = getattr(cls, "_xml", {}) + prop_meta = getattr(discriminator, "_xml", {}) + xml_name = prop_meta.get("name", discriminator._rest_name) + xml_ns = prop_meta.get("ns", model_meta.get("ns", None)) + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + + if data.get(xml_name) is not None: + discriminator_value = data.get(xml_name) + else: + discriminator_value = data.find(xml_name).text # pyright: ignore + else: + discriminator_value = data.get(discriminator._rest_name) + mapped_cls = cls.__mapping__.get(discriminator_value, cls) # pyright: ignore + return mapped_cls._deserialize(data, exist_discriminators) + + def as_dict(self, *, exclude_readonly: bool = False) -> typing.Dict[str, typing.Any]: + """Return a dict that can be turned into json 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 + if isinstance(obj, ET.Element): + obj = {child.tag: child for child in 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 + if isinstance(obj, ET.Element): + obj = list(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=too-many-return-statements, too-many-branches + annotation: typing.Any, + module: typing.Optional[str], + rf: typing.Optional["_RestField"] = None, +) -> typing.Optional[typing.Callable[[typing.Any], typing.Any]]: + if not annotation: + 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) # type: ignore + + 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, +): # pylint: disable=too-many-return-statements + try: + if value is None or isinstance(value, _Null): + return None + if isinstance(value, ET.Element): + if deserializer is str: + return value.text or "" + if deserializer is int: + return int(value.text) if value.text else None + if deserializer is float: + return float(value.text) if value.text else None + if deserializer is bool: + return value.text == "true" if value.text else None + if deserializer is None: + return value + if deserializer in [int, float, bool]: + return deserializer(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) + + +def _failsafe_deserialize( + deserializer: typing.Any, + value: typing.Any, + module: typing.Optional[str] = None, + rf: typing.Optional["_RestField"] = None, + format: typing.Optional[str] = None, +) -> typing.Any: + try: + return _deserialize(deserializer, value, module, rf, format) + except DeserializationError: + _LOGGER.warning( + "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True + ) + return None + + +def _failsafe_deserialize_xml( + deserializer: typing.Any, + value: typing.Any, +) -> typing.Any: + try: + return _deserialize_xml(deserializer, value) + except DeserializationError: + _LOGGER.warning( + "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True + ) + return None + + +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, + xml: typing.Optional[typing.Dict[str, typing.Any]] = None, + ): + 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 + self._xml = xml if xml is not None else {} + + @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, + xml: typing.Optional[typing.Dict[str, typing.Any]] = None, +) -> typing.Any: + return _RestField( + name=name, + type=type, + visibility=visibility, + default=default, + format=format, + is_multipart_file_input=is_multipart_file_input, + xml=xml, + ) + + +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, + xml: typing.Optional[typing.Dict[str, typing.Any]] = None, +) -> typing.Any: + return _RestField(name=name, type=type, is_discriminator=True, visibility=visibility, xml=xml) + + +def serialize_xml(model: Model, exclude_readonly: bool = False) -> str: + """Serialize a model to XML. + + :param Model model: The model to serialize. + :param bool exclude_readonly: Whether to exclude readonly properties. + :returns: The XML representation of the model. + :rtype: str + """ + return ET.tostring(_get_element(model, exclude_readonly), encoding="unicode") # type: ignore + + +def _get_element( + o: typing.Any, + exclude_readonly: bool = False, + parent_meta: typing.Optional[typing.Dict[str, typing.Any]] = None, + wrapped_element: typing.Optional[ET.Element] = None, +) -> typing.Union[ET.Element, typing.List[ET.Element]]: + if _is_model(o): + model_meta = getattr(o, "_xml", {}) + + # if prop is a model, then use the prop element directly, else generate a wrapper of model + if wrapped_element is None: + wrapped_element = _create_xml_element( + model_meta.get("name", o.__class__.__name__), + model_meta.get("prefix"), + model_meta.get("ns"), + ) + + readonly_props = [] + if exclude_readonly: + readonly_props = [p._rest_name for p in o._attr_to_rest_field.values() if _is_readonly(p)] + + for k, v in o.items(): + # do not serialize readonly properties + if exclude_readonly and k in readonly_props: + continue + + prop_rest_field = _get_rest_field(o._attr_to_rest_field, k) + if prop_rest_field: + prop_meta = getattr(prop_rest_field, "_xml").copy() + # use the wire name as xml name if no specific name is set + if prop_meta.get("name") is None: + prop_meta["name"] = k + else: + # additional properties will not have rest field, use the wire name as xml name + prop_meta = {"name": k} + + # if no ns for prop, use model's + if prop_meta.get("ns") is None and model_meta.get("ns"): + prop_meta["ns"] = model_meta.get("ns") + prop_meta["prefix"] = model_meta.get("prefix") + + if prop_meta.get("unwrapped", False): + # unwrapped could only set on array + wrapped_element.extend(_get_element(v, exclude_readonly, prop_meta)) + elif prop_meta.get("text", False): + # text could only set on primitive type + wrapped_element.text = _get_primitive_type_value(v) + elif prop_meta.get("attribute", False): + xml_name = prop_meta.get("name", k) + if prop_meta.get("ns"): + ET.register_namespace(prop_meta.get("prefix"), prop_meta.get("ns")) # pyright: ignore + xml_name = "{" + prop_meta.get("ns") + "}" + xml_name # pyright: ignore + # attribute should be primitive type + wrapped_element.set(xml_name, _get_primitive_type_value(v)) + else: + # other wrapped prop element + wrapped_element.append(_get_wrapped_element(v, exclude_readonly, prop_meta)) + return wrapped_element + if isinstance(o, list): + return [_get_element(x, exclude_readonly, parent_meta) for x in o] # type: ignore + if isinstance(o, dict): + result = [] + for k, v in o.items(): + result.append( + _get_wrapped_element( + v, + exclude_readonly, + { + "name": k, + "ns": parent_meta.get("ns") if parent_meta else None, + "prefix": parent_meta.get("prefix") if parent_meta else None, + }, + ) + ) + return result + + # primitive case need to create element based on parent_meta + if parent_meta: + return _get_wrapped_element( + o, + exclude_readonly, + { + "name": parent_meta.get("itemsName", parent_meta.get("name")), + "prefix": parent_meta.get("itemsPrefix", parent_meta.get("prefix")), + "ns": parent_meta.get("itemsNs", parent_meta.get("ns")), + }, + ) + + raise ValueError("Could not serialize value into xml: " + o) + + +def _get_wrapped_element( + v: typing.Any, + exclude_readonly: bool, + meta: typing.Optional[typing.Dict[str, typing.Any]], +) -> ET.Element: + wrapped_element = _create_xml_element( + meta.get("name") if meta else None, meta.get("prefix") if meta else None, meta.get("ns") if meta else None + ) + if isinstance(v, (dict, list)): + wrapped_element.extend(_get_element(v, exclude_readonly, meta)) + elif _is_model(v): + _get_element(v, exclude_readonly, meta, wrapped_element) + else: + wrapped_element.text = _get_primitive_type_value(v) + return wrapped_element + + +def _get_primitive_type_value(v) -> str: + if v is True: + return "true" + if v is False: + return "false" + if isinstance(v, _Null): + return "" + return str(v) + + +def _create_xml_element(tag, prefix=None, ns=None): + if prefix and ns: + ET.register_namespace(prefix, ns) + if ns: + return ET.Element("{" + ns + "}" + tag) + return ET.Element(tag) + + +def _deserialize_xml( + deserializer: typing.Any, + value: str, +) -> typing.Any: + element = ET.fromstring(value) # nosec + return _deserialize(deserializer, element) + + +def _convert_element(e: ET.Element): + # dict case + if len(e.attrib) > 0 or len({child.tag for child in e}) > 1: + dict_result: typing.Dict[str, typing.Any] = {} + for child in e: + if dict_result.get(child.tag) is not None: + if isinstance(dict_result[child.tag], list): + dict_result[child.tag].append(_convert_element(child)) + else: + dict_result[child.tag] = [dict_result[child.tag], _convert_element(child)] + else: + dict_result[child.tag] = _convert_element(child) + dict_result.update(e.attrib) + return dict_result + # array case + if len(e) > 0: + array_result: typing.List[typing.Any] = [] + for child in e: + array_result.append(_convert_element(child)) + return array_result + # primitive case + return e.text diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_operations/__init__.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_operations/__init__.py new file mode 100644 index 00000000000..4a8ff7f9c39 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_operations/__init__.py @@ -0,0 +1,19 @@ +# coding=utf-8 +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import ResiliencyServiceDrivenClientOperationsMixin # type: ignore + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "ResiliencyServiceDrivenClientOperationsMixin", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_operations/_operations.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_operations/_operations.py new file mode 100644 index 00000000000..0e5b9651387 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_operations/_operations.py @@ -0,0 +1,318 @@ +# coding=utf-8 +import sys +from typing import Any, Callable, Dict, Optional, 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 .._validation import api_version_validation +from .._vendor import ResiliencyServiceDrivenClientMixinABC + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False + + +def build_resiliency_service_driven_add_operation_request( # pylint: disable=name-too-long + **kwargs: Any, +) -> HttpRequest: + # Construct URL + _url = "/add-operation" + + return HttpRequest(method="DELETE", url=_url, **kwargs) + + +def build_resiliency_service_driven_from_none_request( # pylint: disable=name-too-long + *, new_parameter: Optional[str] = None, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + # Construct URL + _url = "/add-optional-param/from-none" + + # Construct parameters + if new_parameter is not None: + _params["new-parameter"] = _SERIALIZER.query("new_parameter", new_parameter, "str") + + return HttpRequest(method="HEAD", url=_url, params=_params, **kwargs) + + +def build_resiliency_service_driven_from_one_required_request( # pylint: disable=name-too-long + *, parameter: str, new_parameter: Optional[str] = None, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + # Construct URL + _url = "/add-optional-param/from-one-required" + + # Construct parameters + _params["parameter"] = _SERIALIZER.query("parameter", parameter, "str") + if new_parameter is not None: + _params["new-parameter"] = _SERIALIZER.query("new_parameter", new_parameter, "str") + + return HttpRequest(method="GET", url=_url, params=_params, **kwargs) + + +def build_resiliency_service_driven_from_one_optional_request( # pylint: disable=name-too-long + *, parameter: Optional[str] = None, new_parameter: Optional[str] = None, **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + # Construct URL + _url = "/add-optional-param/from-one-optional" + + # Construct parameters + if parameter is not None: + _params["parameter"] = _SERIALIZER.query("parameter", parameter, "str") + if new_parameter is not None: + _params["new-parameter"] = _SERIALIZER.query("new_parameter", new_parameter, "str") + + return HttpRequest(method="GET", url=_url, params=_params, **kwargs) + + +class ResiliencyServiceDrivenClientOperationsMixin( # pylint: disable=name-too-long + ResiliencyServiceDrivenClientMixinABC +): + + @distributed_trace + @api_version_validation( + method_added_on="v2", + ) + def add_operation(self, **kwargs: Any) -> None: # pylint: disable=inconsistent-return-statements + """Added operation. + + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_resiliency_service_driven_add_operation_request( + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "serviceDeploymentVersion": self._serialize.url( + "self._config.service_deployment_version", self._config.service_deployment_version, "str" + ), + "apiVersion": self._serialize.url("self._config.api_version", self._config.api_version, "str"), + } + _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 + @api_version_validation( + params_added_on={"v2": ["new_parameter"]}, + ) + def from_none(self, *, new_parameter: Optional[str] = None, **kwargs: Any) -> bool: + """Test that grew up from accepting no parameters to an optional input parameter. + + :keyword new_parameter: I'm a new input optional parameter. Default value is None. + :paramtype new_parameter: str + :return: bool + :rtype: bool + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_resiliency_service_driven_from_none_request( + new_parameter=new_parameter, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "serviceDeploymentVersion": self._serialize.url( + "self._config.service_deployment_version", self._config.service_deployment_version, "str" + ), + "apiVersion": self._serialize.url("self._config.api_version", self._config.api_version, "str"), + } + _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 + @api_version_validation( + params_added_on={"v2": ["new_parameter"]}, + ) + def from_one_required( # pylint: disable=inconsistent-return-statements + self, *, parameter: str, new_parameter: Optional[str] = None, **kwargs: Any + ) -> None: + """Operation that grew up from accepting one required parameter to accepting a required parameter + and an optional parameter. + + :keyword parameter: I am a required parameter. Required. + :paramtype parameter: str + :keyword new_parameter: I'm a new input optional parameter. Default value is None. + :paramtype new_parameter: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_resiliency_service_driven_from_one_required_request( + parameter=parameter, + new_parameter=new_parameter, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "serviceDeploymentVersion": self._serialize.url( + "self._config.service_deployment_version", self._config.service_deployment_version, "str" + ), + "apiVersion": self._serialize.url("self._config.api_version", self._config.api_version, "str"), + } + _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 + @api_version_validation( + params_added_on={"v2": ["new_parameter"]}, + ) + def from_one_optional( # pylint: disable=inconsistent-return-statements + self, *, parameter: Optional[str] = None, new_parameter: Optional[str] = None, **kwargs: Any + ) -> None: + """Tests that we can grow up an operation from accepting one optional parameter to accepting two + optional parameters. + + :keyword parameter: I am an optional parameter. Default value is None. + :paramtype parameter: str + :keyword new_parameter: I'm a new input optional parameter. Default value is None. + :paramtype new_parameter: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_resiliency_service_driven_from_one_optional_request( + parameter=parameter, + new_parameter=new_parameter, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "serviceDeploymentVersion": self._serialize.url( + "self._config.service_deployment_version", self._config.service_deployment_version, "str" + ), + "apiVersion": self._serialize.url("self._config.api_version", self._config.api_version, "str"), + } + _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/resiliency-srv-driven2/resiliency/srv/driven2/_operations/_patch.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_operations/_patch.py new file mode 100644 index 00000000000..8bcb627aa47 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_operations/_patch.py @@ -0,0 +1,21 @@ +# 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. +# -------------------------------------------------------------------------- +"""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/resiliency-srv-driven2/resiliency/srv/driven2/_patch.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_patch.py new file mode 100644 index 00000000000..8bcb627aa47 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_patch.py @@ -0,0 +1,21 @@ +# 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. +# -------------------------------------------------------------------------- +"""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/resiliency-srv-driven2/resiliency/srv/driven2/_serialization.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_serialization.py new file mode 100644 index 00000000000..f71dbc0833e --- /dev/null +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_serialization.py @@ -0,0 +1,2026 @@ +# pylint: disable=line-too-long,useless-suppression,too-many-lines +# coding=utf-8 + +# 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, + MutableMapping, + 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 typing_extensions import Self + +from azure.core.exceptions import DeserializationError, SerializationError +from azure.core.serialization import NULL as CoreNull + +_BOM = codecs.BOM_UTF8.decode(encoding="utf-8") + +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 + +TZ_UTC = datetime.timezone.utc + +_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, data: Any, content_type: Optional[str] = None) -> Self: + """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: Self + """ + deserializer = Deserializer(cls._infer_class_models()) + return deserializer(cls.__name__, data, content_type=content_type) # type: ignore + + @classmethod + def from_dict( + cls, + data: Any, + key_extractors: Optional[Callable[[str, Dict[str, Any], Any], Any]] = None, + content_type: Optional[str] = None, + ) -> Self: + """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: Self + """ + 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. + + :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.get(rest_api_response_key, None) or response.get(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: # 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) -> 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( + 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: + """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) -> 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() # pylint: disable=protected-access # type: ignore + if v.get("readonly") + ] + const = [ + k + for k, v in response._validation.items() # pylint: disable=protected-access # type: ignore + if v.get("constant") + ] + 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 # type: ignore + 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=datetime.timezone(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/resiliency-srv-driven2/resiliency/srv/driven2/_validation.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_validation.py new file mode 100644 index 00000000000..964148cf00e --- /dev/null +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_validation.py @@ -0,0 +1,44 @@ +import functools + + +def api_version_validation(**kwargs): + params_added_on = kwargs.pop("params_added_on", {}) + method_added_on = kwargs.pop("method_added_on", "") + + def decorator(func): + @functools.wraps(func) + def wrapper(*args, **kwargs): + try: + # this assumes the client has an _api_version attribute + client = args[0] + client_api_version = client._config.api_version # pylint: disable=protected-access + except AttributeError: + return func(*args, **kwargs) + + if method_added_on > client_api_version: + raise ValueError( + f"'{func.__name__}' is not available in API version " + f"{client_api_version}. Pass service API version {method_added_on} or newer to your client." + ) + + unsupported = { + parameter: api_version + for api_version, parameters in params_added_on.items() + for parameter in parameters + if parameter in kwargs and api_version > client_api_version + } + if unsupported: + raise ValueError( + "".join( + [ + f"'{param}' is not available in API version {client_api_version}. " + f"Use service API version {version} or newer.\n" + for param, version in unsupported.items() + ] + ) + ) + return func(*args, **kwargs) + + return wrapper + + return decorator diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_vendor.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_vendor.py new file mode 100644 index 00000000000..a1f1bf8898a --- /dev/null +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_vendor.py @@ -0,0 +1,18 @@ +from abc import ABC +from typing import TYPE_CHECKING + +from ._configuration import ResiliencyServiceDrivenClientConfiguration + +if TYPE_CHECKING: + from azure.core import PipelineClient + + from ._serialization import Deserializer, Serializer + + +class ResiliencyServiceDrivenClientMixinABC(ABC): + """DO NOT use this class. It is for internal typing use only.""" + + _client: "PipelineClient" + _config: ResiliencyServiceDrivenClientConfiguration + _serialize: "Serializer" + _deserialize: "Deserializer" diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_version.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_version.py new file mode 100644 index 00000000000..9f6458b8cda --- /dev/null +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/_version.py @@ -0,0 +1,3 @@ +# coding=utf-8 + +VERSION = "1.0.0b1" diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/aio/__init__.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/aio/__init__.py new file mode 100644 index 00000000000..4f41aabeaa2 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/aio/__init__.py @@ -0,0 +1,23 @@ +# coding=utf-8 +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._client import ResiliencyServiceDrivenClient # type: ignore + +try: + from ._patch import __all__ as _patch_all + from ._patch import * +except ImportError: + _patch_all = [] +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "ResiliencyServiceDrivenClient", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore + +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/aio/_client.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/aio/_client.py new file mode 100644 index 00000000000..1f90d8deab5 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/aio/_client.py @@ -0,0 +1,122 @@ +# coding=utf-8 + +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 ResiliencyServiceDrivenClientConfiguration +from ._operations import ResiliencyServiceDrivenClientOperationsMixin + + +class ResiliencyServiceDrivenClient(ResiliencyServiceDrivenClientOperationsMixin): + """Test that we can grow up a service spec and service deployment into a multi-versioned service + with full client support. + + There are three concepts that should be clarified: + + 1. Client spec version: refers to the spec that the client is generated from. 'v1' is a client + generated from old.tsp and 'v2' is a client generated from main.tsp. + 2. Service deployment version: refers to a deployment version of the service. 'v1' represents + the initial deployment of the service with a single api version. 'v2' represents the new + deployment of a service with multiple api versions + 3. Api version: The initial deployment of the service only supports api version 'v1'. The new + deployment of the service supports api versions 'v1' and 'v2'. + + We test the following configurations from this service spec: + + * A client generated from the second service spec can call the second deployment of a service + with api version v1 + * A client generated from the second service spec can call the second deployment of a service + with api version v2. + + :param endpoint: Need to be set as '`http://localhost:3000 `_' in + client. Required. + :type endpoint: str + :param service_deployment_version: Pass in either 'v1' or 'v2'. This represents a version of + the service deployment in history. 'v1' is for the deployment when the service had only one api + version. 'v2' is for the deployment when the service had api-versions 'v1' and 'v2'. Required. + :type service_deployment_version: str + :keyword api_version: Pass in either 'v1' or 'v2'. This represents the API version of a + service. Known values are "v2" and None. Default value is "v2". Note that overriding this + default value may result in unsupported behavior. + :paramtype api_version: str + """ + + def __init__( # pylint: disable=missing-client-constructor-parameter-credential + self, endpoint: str, service_deployment_version: str, **kwargs: Any + ) -> None: + _endpoint = ( + "{endpoint}/resiliency/service-driven/client:v2/service:{serviceDeploymentVersion}/api-version:{apiVersion}" + ) + self._config = ResiliencyServiceDrivenClientConfiguration( + endpoint=endpoint, service_deployment_version=service_deployment_version, **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 + + 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), + "serviceDeploymentVersion": self._serialize.url( + "self._config.service_deployment_version", self._config.service_deployment_version, "str" + ), + "apiVersion": self._serialize.url("self._config.api_version", self._config.api_version, "str"), + } + + 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/resiliency-srv-driven2/resiliency/srv/driven2/aio/_configuration.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/aio/_configuration.py new file mode 100644 index 00000000000..e17d5396869 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/aio/_configuration.py @@ -0,0 +1,53 @@ +# coding=utf-8 + +from typing import Any + +from azure.core.pipeline import policies + +from .._version import VERSION + + +class ResiliencyServiceDrivenClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long + """Configuration for ResiliencyServiceDrivenClient. + + Note that all parameters used to create this instance are saved as instance + attributes. + + :param endpoint: Need to be set as '`http://localhost:3000 `_' in + client. Required. + :type endpoint: str + :param service_deployment_version: Pass in either 'v1' or 'v2'. This represents a version of + the service deployment in history. 'v1' is for the deployment when the service had only one api + version. 'v2' is for the deployment when the service had api-versions 'v1' and 'v2'. Required. + :type service_deployment_version: str + :keyword api_version: Pass in either 'v1' or 'v2'. This represents the API version of a + service. Known values are "v2" and None. Default value is "v2". Note that overriding this + default value may result in unsupported behavior. + :paramtype api_version: str + """ + + def __init__(self, endpoint: str, service_deployment_version: str, **kwargs: Any) -> None: + api_version: str = kwargs.pop("api_version", "v2") + + if endpoint is None: + raise ValueError("Parameter 'endpoint' must not be None.") + if service_deployment_version is None: + raise ValueError("Parameter 'service_deployment_version' must not be None.") + + self.endpoint = endpoint + self.service_deployment_version = service_deployment_version + self.api_version = api_version + kwargs.setdefault("sdk_moniker", "resiliency-srv-driven2/{}".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/resiliency-srv-driven2/resiliency/srv/driven2/aio/_operations/__init__.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/aio/_operations/__init__.py new file mode 100644 index 00000000000..4a8ff7f9c39 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/aio/_operations/__init__.py @@ -0,0 +1,19 @@ +# coding=utf-8 +# pylint: disable=wrong-import-position + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from ._patch import * # pylint: disable=unused-wildcard-import + +from ._operations import ResiliencyServiceDrivenClientOperationsMixin # type: ignore + +from ._patch import __all__ as _patch_all +from ._patch import * +from ._patch import patch_sdk as _patch_sdk + +__all__ = [ + "ResiliencyServiceDrivenClientOperationsMixin", +] +__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore +_patch_sdk() diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/aio/_operations/_operations.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/aio/_operations/_operations.py new file mode 100644 index 00000000000..97493602f33 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/aio/_operations/_operations.py @@ -0,0 +1,261 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +import sys +from typing import Any, Callable, Dict, Optional, 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_resiliency_service_driven_add_operation_request, + build_resiliency_service_driven_from_none_request, + build_resiliency_service_driven_from_one_optional_request, + build_resiliency_service_driven_from_one_required_request, +) +from ..._validation import api_version_validation +from .._vendor import ResiliencyServiceDrivenClientMixinABC + +if sys.version_info >= (3, 9): + from collections.abc import MutableMapping +else: + from typing import MutableMapping # type: ignore +T = TypeVar("T") +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + + +class ResiliencyServiceDrivenClientOperationsMixin( # pylint: disable=name-too-long + ResiliencyServiceDrivenClientMixinABC +): + + @distributed_trace_async + @api_version_validation( + method_added_on="v2", + ) + async def add_operation(self, **kwargs: Any) -> None: + """Added operation. + + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_resiliency_service_driven_add_operation_request( + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "serviceDeploymentVersion": self._serialize.url( + "self._config.service_deployment_version", self._config.service_deployment_version, "str" + ), + "apiVersion": self._serialize.url("self._config.api_version", self._config.api_version, "str"), + } + _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 + + @distributed_trace_async + @api_version_validation( + params_added_on={"v2": ["new_parameter"]}, + ) + async def from_none(self, *, new_parameter: Optional[str] = None, **kwargs: Any) -> bool: + """Test that grew up from accepting no parameters to an optional input parameter. + + :keyword new_parameter: I'm a new input optional parameter. Default value is None. + :paramtype new_parameter: str + :return: bool + :rtype: bool + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_resiliency_service_driven_from_none_request( + new_parameter=new_parameter, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "serviceDeploymentVersion": self._serialize.url( + "self._config.service_deployment_version", self._config.service_deployment_version, "str" + ), + "apiVersion": self._serialize.url("self._config.api_version", self._config.api_version, "str"), + } + _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 + @api_version_validation( + params_added_on={"v2": ["new_parameter"]}, + ) + async def from_one_required(self, *, parameter: str, new_parameter: Optional[str] = None, **kwargs: Any) -> None: + """Operation that grew up from accepting one required parameter to accepting a required parameter + and an optional parameter. + + :keyword parameter: I am a required parameter. Required. + :paramtype parameter: str + :keyword new_parameter: I'm a new input optional parameter. Default value is None. + :paramtype new_parameter: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_resiliency_service_driven_from_one_required_request( + parameter=parameter, + new_parameter=new_parameter, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "serviceDeploymentVersion": self._serialize.url( + "self._config.service_deployment_version", self._config.service_deployment_version, "str" + ), + "apiVersion": self._serialize.url("self._config.api_version", self._config.api_version, "str"), + } + _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 + + @distributed_trace_async + @api_version_validation( + params_added_on={"v2": ["new_parameter"]}, + ) + async def from_one_optional( + self, *, parameter: Optional[str] = None, new_parameter: Optional[str] = None, **kwargs: Any + ) -> None: + """Tests that we can grow up an operation from accepting one optional parameter to accepting two + optional parameters. + + :keyword parameter: I am an optional parameter. Default value is None. + :paramtype parameter: str + :keyword new_parameter: I'm a new input optional parameter. Default value is None. + :paramtype new_parameter: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_resiliency_service_driven_from_one_optional_request( + parameter=parameter, + new_parameter=new_parameter, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.endpoint", self._config.endpoint, "str", skip_quote=True), + "serviceDeploymentVersion": self._serialize.url( + "self._config.service_deployment_version", self._config.service_deployment_version, "str" + ), + "apiVersion": self._serialize.url("self._config.api_version", self._config.api_version, "str"), + } + _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/resiliency-srv-driven2/resiliency/srv/driven2/aio/_operations/_patch.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/aio/_operations/_patch.py new file mode 100644 index 00000000000..8bcb627aa47 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/aio/_operations/_patch.py @@ -0,0 +1,21 @@ +# 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. +# -------------------------------------------------------------------------- +"""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/resiliency-srv-driven2/resiliency/srv/driven2/aio/_patch.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/aio/_patch.py new file mode 100644 index 00000000000..8bcb627aa47 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/aio/_patch.py @@ -0,0 +1,21 @@ +# 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. +# -------------------------------------------------------------------------- +"""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/resiliency-srv-driven2/resiliency/srv/driven2/aio/_vendor.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/aio/_vendor.py new file mode 100644 index 00000000000..a683c047d98 --- /dev/null +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/aio/_vendor.py @@ -0,0 +1,18 @@ +from abc import ABC +from typing import TYPE_CHECKING + +from ._configuration import ResiliencyServiceDrivenClientConfiguration + +if TYPE_CHECKING: + from azure.core import AsyncPipelineClient + + from .._serialization import Deserializer, Serializer + + +class ResiliencyServiceDrivenClientMixinABC(ABC): + """DO NOT use this class. It is for internal typing use only.""" + + _client: "AsyncPipelineClient" + _config: ResiliencyServiceDrivenClientConfiguration + _serialize: "Serializer" + _deserialize: "Deserializer" diff --git a/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/py.typed b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/py.typed new file mode 100644 index 00000000000..e5aff4f83af --- /dev/null +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/resiliency/srv/driven2/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/resiliency-srv-driven2/setup.py b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/setup.py new file mode 100644 index 00000000000..fa5b438752d --- /dev/null +++ b/packages/typespec-python/test/azure/generated/resiliency-srv-driven2/setup.py @@ -0,0 +1,65 @@ +# coding=utf-8 + + +import os +import re +from setuptools import setup, find_packages + + +PACKAGE_NAME = "resiliency-srv-driven2" +PACKAGE_PPRINT_NAME = "ResiliencySrvDriven2" + +# 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 Corporation {} 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", + # Exclude packages that will be covered by PEP420 or nspkg + "resiliency", + "resiliency.srv", + ] + ), + include_package_data=True, + package_data={ + "resiliency.srv.driven2": ["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/unbranded/generated/typetest-union/typetest/union/aio/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/typetest-union/typetest/union/aio/operations/_operations.py index e07473ff21e..60cba86cafe 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-union/typetest/union/aio/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-union/typetest/union/aio/operations/_operations.py @@ -74,11 +74,11 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - async def get(self, **kwargs: Any) -> _models.GetResponse9: + async def get(self, **kwargs: Any) -> _models.GetResponse: """get. - :return: GetResponse9. The GetResponse9 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse9 + :return: GetResponse. The GetResponse is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse :raises ~corehttp.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -92,7 +92,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse9: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse9] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse] = kwargs.pop("cls", None) _request = build_strings_only_get_request( headers=_headers, @@ -120,7 +120,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse9: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse9, response.json()) + deserialized = _deserialize(_models.GetResponse, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -253,11 +253,11 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - async def get(self, **kwargs: Any) -> _models.GetResponse8: + async def get(self, **kwargs: Any) -> _models.GetResponse1: """get. - :return: GetResponse8. The GetResponse8 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse8 + :return: GetResponse1. The GetResponse1 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse1 :raises ~corehttp.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -271,7 +271,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse8: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse8] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse1] = kwargs.pop("cls", None) _request = build_string_extensible_get_request( headers=_headers, @@ -299,7 +299,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse8: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse8, response.json()) + deserialized = _deserialize(_models.GetResponse1, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -434,11 +434,11 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - async def get(self, **kwargs: Any) -> _models.GetResponse7: + async def get(self, **kwargs: Any) -> _models.GetResponse2: """get. - :return: GetResponse7. The GetResponse7 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse7 + :return: GetResponse2. The GetResponse2 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse2 :raises ~corehttp.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -452,7 +452,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse7: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse7] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse2] = kwargs.pop("cls", None) _request = build_string_extensible_named_get_request( headers=_headers, @@ -480,7 +480,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse7: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse7, response.json()) + deserialized = _deserialize(_models.GetResponse2, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -619,11 +619,11 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - async def get(self, **kwargs: Any) -> _models.GetResponse6: + async def get(self, **kwargs: Any) -> _models.GetResponse3: """get. - :return: GetResponse6. The GetResponse6 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse6 + :return: GetResponse3. The GetResponse3 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse3 :raises ~corehttp.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -637,7 +637,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse6: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse6] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse3] = kwargs.pop("cls", None) _request = build_ints_only_get_request( headers=_headers, @@ -665,7 +665,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse6: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse6, response.json()) + deserialized = _deserialize(_models.GetResponse3, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -794,11 +794,11 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - async def get(self, **kwargs: Any) -> _models.GetResponse5: + async def get(self, **kwargs: Any) -> _models.GetResponse4: """get. - :return: GetResponse5. The GetResponse5 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse5 + :return: GetResponse4. The GetResponse4 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse4 :raises ~corehttp.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -812,7 +812,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse5: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse5] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse4] = kwargs.pop("cls", None) _request = build_floats_only_get_request( headers=_headers, @@ -840,7 +840,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse5: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse5, response.json()) + deserialized = _deserialize(_models.GetResponse4, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -967,11 +967,11 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - async def get(self, **kwargs: Any) -> _models.GetResponse4: + async def get(self, **kwargs: Any) -> _models.GetResponse5: """get. - :return: GetResponse4. The GetResponse4 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse4 + :return: GetResponse5. The GetResponse5 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse5 :raises ~corehttp.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -985,7 +985,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse4: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse4] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse5] = kwargs.pop("cls", None) _request = build_models_only_get_request( headers=_headers, @@ -1013,7 +1013,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse4: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse4, response.json()) + deserialized = _deserialize(_models.GetResponse5, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1144,11 +1144,11 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - async def get(self, **kwargs: Any) -> _models.GetResponse3: + async def get(self, **kwargs: Any) -> _models.GetResponse6: """get. - :return: GetResponse3. The GetResponse3 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse3 + :return: GetResponse6. The GetResponse6 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse6 :raises ~corehttp.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1162,7 +1162,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse3: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse3] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse6] = kwargs.pop("cls", None) _request = build_enums_only_get_request( headers=_headers, @@ -1190,7 +1190,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse3: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse3, response.json()) + deserialized = _deserialize(_models.GetResponse6, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1321,11 +1321,11 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - async def get(self, **kwargs: Any) -> _models.GetResponse2: + async def get(self, **kwargs: Any) -> _models.GetResponse7: """get. - :return: GetResponse2. The GetResponse2 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse2 + :return: GetResponse7. The GetResponse7 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse7 :raises ~corehttp.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1339,7 +1339,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse2: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse2] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse7] = kwargs.pop("cls", None) _request = build_string_and_array_get_request( headers=_headers, @@ -1367,7 +1367,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse2: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse2, response.json()) + deserialized = _deserialize(_models.GetResponse7, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1498,11 +1498,11 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - async def get(self, **kwargs: Any) -> _models.GetResponse1: + async def get(self, **kwargs: Any) -> _models.GetResponse8: """get. - :return: GetResponse1. The GetResponse1 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse1 + :return: GetResponse8. The GetResponse8 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse8 :raises ~corehttp.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1516,7 +1516,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse1: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse1] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse8] = kwargs.pop("cls", None) _request = build_mixed_literals_get_request( headers=_headers, @@ -1544,7 +1544,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse1: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse1, response.json()) + deserialized = _deserialize(_models.GetResponse8, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1675,11 +1675,11 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - async def get(self, **kwargs: Any) -> _models.GetResponse: + async def get(self, **kwargs: Any) -> _models.GetResponse9: """get. - :return: GetResponse. The GetResponse is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse + :return: GetResponse9. The GetResponse9 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse9 :raises ~corehttp.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1693,7 +1693,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse9] = kwargs.pop("cls", None) _request = build_mixed_types_get_request( headers=_headers, @@ -1721,7 +1721,7 @@ async def get(self, **kwargs: Any) -> _models.GetResponse: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse, response.json()) + deserialized = _deserialize(_models.GetResponse9, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore diff --git a/packages/typespec-python/test/unbranded/generated/typetest-union/typetest/union/models/_models.py b/packages/typespec-python/test/unbranded/generated/typetest-union/typetest/union/models/_models.py index bdb8c270df3..8a5b2e4ac34 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-union/typetest/union/models/_models.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-union/typetest/union/models/_models.py @@ -106,18 +106,18 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class GetResponse(_model_base.Model): """GetResponse. - :ivar prop: Required. - :vartype prop: ~typetest.union.models.MixedTypesCases + :ivar prop: Required. Is one of the following types: Literal["a"], Literal["b"], Literal["c"] + :vartype prop: str or str or str """ - prop: "_models.MixedTypesCases" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" + prop: Literal["a", "b", "c"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Is one of the following types: Literal[\"a\"], Literal[\"b\"], Literal[\"c\"]""" @overload def __init__( self, *, - prop: "_models.MixedTypesCases", + prop: Literal["a", "b", "c"], ) -> None: ... @overload @@ -134,18 +134,20 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class GetResponse1(_model_base.Model): """GetResponse1. - :ivar prop: Required. - :vartype prop: ~typetest.union.models.MixedLiteralsCases + :ivar prop: Required. Is one of the following types: Literal["b"], Literal["c"], str + :vartype prop: str or str or str """ - prop: "_models.MixedLiteralsCases" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" + prop: Union[Literal["b"], Literal["c"], str] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Required. Is one of the following types: Literal[\"b\"], Literal[\"c\"], str""" @overload def __init__( self, *, - prop: "_models.MixedLiteralsCases", + prop: Union[Literal["b"], Literal["c"], str], ) -> None: ... @overload @@ -162,18 +164,20 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class GetResponse2(_model_base.Model): """GetResponse2. - :ivar prop: Required. - :vartype prop: ~typetest.union.models.StringAndArrayCases + :ivar prop: Required. Known values are: "b" and "c". + :vartype prop: str or ~typetest.union.models.StringExtensibleNamedUnion """ - prop: "_models.StringAndArrayCases" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" + prop: Union[str, "_models.StringExtensibleNamedUnion"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Required. Known values are: \"b\" and \"c\".""" @overload def __init__( self, *, - prop: "_models.StringAndArrayCases", + prop: Union[str, "_models.StringExtensibleNamedUnion"], ) -> None: ... @overload @@ -190,18 +194,18 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class GetResponse3(_model_base.Model): """GetResponse3. - :ivar prop: Required. - :vartype prop: ~typetest.union.models.EnumsOnlyCases + :ivar prop: Required. Is one of the following types: Literal[1], Literal[2], Literal[3] + :vartype prop: int or int or int """ - prop: "_models.EnumsOnlyCases" = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required.""" + prop: Literal[1, 2, 3] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Is one of the following types: Literal[1], Literal[2], Literal[3]""" @overload def __init__( self, *, - prop: "_models.EnumsOnlyCases", + prop: Literal[1, 2, 3], ) -> None: ... @overload @@ -218,18 +222,18 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class GetResponse4(_model_base.Model): """GetResponse4. - :ivar prop: Required. Is either a Cat type or a Dog type. - :vartype prop: ~typetest.union.models.Cat or ~typetest.union.models.Dog + :ivar prop: Required. Is one of the following types: float + :vartype prop: float or float or float """ - prop: Union["_models.Cat", "_models.Dog"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required. Is either a Cat type or a Dog type.""" + prop: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Is one of the following types: float""" @overload def __init__( self, *, - prop: Union["_models.Cat", "_models.Dog"], + prop: float, ) -> None: ... @overload @@ -246,18 +250,18 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class GetResponse5(_model_base.Model): """GetResponse5. - :ivar prop: Required. Is one of the following types: float - :vartype prop: float or float or float + :ivar prop: Required. Is either a Cat type or a Dog type. + :vartype prop: ~typetest.union.models.Cat or ~typetest.union.models.Dog """ - prop: float = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required. Is one of the following types: float""" + prop: Union["_models.Cat", "_models.Dog"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required. Is either a Cat type or a Dog type.""" @overload def __init__( self, *, - prop: float, + prop: Union["_models.Cat", "_models.Dog"], ) -> None: ... @overload @@ -274,18 +278,18 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class GetResponse6(_model_base.Model): """GetResponse6. - :ivar prop: Required. Is one of the following types: Literal[1], Literal[2], Literal[3] - :vartype prop: int or int or int + :ivar prop: Required. + :vartype prop: ~typetest.union.models.EnumsOnlyCases """ - prop: Literal[1, 2, 3] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required. Is one of the following types: Literal[1], Literal[2], Literal[3]""" + prop: "_models.EnumsOnlyCases" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" @overload def __init__( self, *, - prop: Literal[1, 2, 3], + prop: "_models.EnumsOnlyCases", ) -> None: ... @overload @@ -302,20 +306,18 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class GetResponse7(_model_base.Model): """GetResponse7. - :ivar prop: Required. Known values are: "b" and "c". - :vartype prop: str or ~typetest.union.models.StringExtensibleNamedUnion + :ivar prop: Required. + :vartype prop: ~typetest.union.models.StringAndArrayCases """ - prop: Union[str, "_models.StringExtensibleNamedUnion"] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Required. Known values are: \"b\" and \"c\".""" + prop: "_models.StringAndArrayCases" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" @overload def __init__( self, *, - prop: Union[str, "_models.StringExtensibleNamedUnion"], + prop: "_models.StringAndArrayCases", ) -> None: ... @overload @@ -332,20 +334,18 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class GetResponse8(_model_base.Model): """GetResponse8. - :ivar prop: Required. Is one of the following types: Literal["b"], Literal["c"], str - :vartype prop: str or str or str + :ivar prop: Required. + :vartype prop: ~typetest.union.models.MixedLiteralsCases """ - prop: Union[Literal["b"], Literal["c"], str] = rest_field( - visibility=["read", "create", "update", "delete", "query"] - ) - """Required. Is one of the following types: Literal[\"b\"], Literal[\"c\"], str""" + prop: "_models.MixedLiteralsCases" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" @overload def __init__( self, *, - prop: Union[Literal["b"], Literal["c"], str], + prop: "_models.MixedLiteralsCases", ) -> None: ... @overload @@ -362,18 +362,18 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: class GetResponse9(_model_base.Model): """GetResponse9. - :ivar prop: Required. Is one of the following types: Literal["a"], Literal["b"], Literal["c"] - :vartype prop: str or str or str + :ivar prop: Required. + :vartype prop: ~typetest.union.models.MixedTypesCases """ - prop: Literal["a", "b", "c"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) - """Required. Is one of the following types: Literal[\"a\"], Literal[\"b\"], Literal[\"c\"]""" + prop: "_models.MixedTypesCases" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" @overload def __init__( self, *, - prop: Literal["a", "b", "c"], + prop: "_models.MixedTypesCases", ) -> None: ... @overload diff --git a/packages/typespec-python/test/unbranded/generated/typetest-union/typetest/union/operations/_operations.py b/packages/typespec-python/test/unbranded/generated/typetest-union/typetest/union/operations/_operations.py index 33a1740b43c..e966cb65a14 100644 --- a/packages/typespec-python/test/unbranded/generated/typetest-union/typetest/union/operations/_operations.py +++ b/packages/typespec-python/test/unbranded/generated/typetest-union/typetest/union/operations/_operations.py @@ -335,11 +335,11 @@ def __init__(self, *args, **kwargs): self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - def get(self, **kwargs: Any) -> _models.GetResponse9: + def get(self, **kwargs: Any) -> _models.GetResponse: """get. - :return: GetResponse9. The GetResponse9 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse9 + :return: GetResponse. The GetResponse is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse :raises ~corehttp.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -353,7 +353,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse9: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse9] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse] = kwargs.pop("cls", None) _request = build_strings_only_get_request( headers=_headers, @@ -381,7 +381,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse9: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse9, response.json()) + deserialized = _deserialize(_models.GetResponse, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -512,11 +512,11 @@ def __init__(self, *args, **kwargs): self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - def get(self, **kwargs: Any) -> _models.GetResponse8: + def get(self, **kwargs: Any) -> _models.GetResponse1: """get. - :return: GetResponse8. The GetResponse8 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse8 + :return: GetResponse1. The GetResponse1 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse1 :raises ~corehttp.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -530,7 +530,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse8: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse8] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse1] = kwargs.pop("cls", None) _request = build_string_extensible_get_request( headers=_headers, @@ -558,7 +558,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse8: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse8, response.json()) + deserialized = _deserialize(_models.GetResponse1, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -693,11 +693,11 @@ def __init__(self, *args, **kwargs): self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - def get(self, **kwargs: Any) -> _models.GetResponse7: + def get(self, **kwargs: Any) -> _models.GetResponse2: """get. - :return: GetResponse7. The GetResponse7 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse7 + :return: GetResponse2. The GetResponse2 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse2 :raises ~corehttp.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -711,7 +711,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse7: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse7] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse2] = kwargs.pop("cls", None) _request = build_string_extensible_named_get_request( headers=_headers, @@ -739,7 +739,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse7: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse7, response.json()) + deserialized = _deserialize(_models.GetResponse2, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -878,11 +878,11 @@ def __init__(self, *args, **kwargs): self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - def get(self, **kwargs: Any) -> _models.GetResponse6: + def get(self, **kwargs: Any) -> _models.GetResponse3: """get. - :return: GetResponse6. The GetResponse6 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse6 + :return: GetResponse3. The GetResponse3 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse3 :raises ~corehttp.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -896,7 +896,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse6: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse6] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse3] = kwargs.pop("cls", None) _request = build_ints_only_get_request( headers=_headers, @@ -924,7 +924,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse6: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse6, response.json()) + deserialized = _deserialize(_models.GetResponse3, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1053,11 +1053,11 @@ def __init__(self, *args, **kwargs): self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - def get(self, **kwargs: Any) -> _models.GetResponse5: + def get(self, **kwargs: Any) -> _models.GetResponse4: """get. - :return: GetResponse5. The GetResponse5 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse5 + :return: GetResponse4. The GetResponse4 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse4 :raises ~corehttp.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1071,7 +1071,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse5: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse5] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse4] = kwargs.pop("cls", None) _request = build_floats_only_get_request( headers=_headers, @@ -1099,7 +1099,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse5: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse5, response.json()) + deserialized = _deserialize(_models.GetResponse4, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1228,11 +1228,11 @@ def __init__(self, *args, **kwargs): self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - def get(self, **kwargs: Any) -> _models.GetResponse4: + def get(self, **kwargs: Any) -> _models.GetResponse5: """get. - :return: GetResponse4. The GetResponse4 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse4 + :return: GetResponse5. The GetResponse5 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse5 :raises ~corehttp.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1246,7 +1246,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse4: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse4] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse5] = kwargs.pop("cls", None) _request = build_models_only_get_request( headers=_headers, @@ -1274,7 +1274,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse4: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse4, response.json()) + deserialized = _deserialize(_models.GetResponse5, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1405,11 +1405,11 @@ def __init__(self, *args, **kwargs): self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - def get(self, **kwargs: Any) -> _models.GetResponse3: + def get(self, **kwargs: Any) -> _models.GetResponse6: """get. - :return: GetResponse3. The GetResponse3 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse3 + :return: GetResponse6. The GetResponse6 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse6 :raises ~corehttp.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1423,7 +1423,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse3: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse3] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse6] = kwargs.pop("cls", None) _request = build_enums_only_get_request( headers=_headers, @@ -1451,7 +1451,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse3: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse3, response.json()) + deserialized = _deserialize(_models.GetResponse6, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1580,11 +1580,11 @@ def __init__(self, *args, **kwargs): self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - def get(self, **kwargs: Any) -> _models.GetResponse2: + def get(self, **kwargs: Any) -> _models.GetResponse7: """get. - :return: GetResponse2. The GetResponse2 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse2 + :return: GetResponse7. The GetResponse7 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse7 :raises ~corehttp.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1598,7 +1598,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse2: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse2] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse7] = kwargs.pop("cls", None) _request = build_string_and_array_get_request( headers=_headers, @@ -1626,7 +1626,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse2: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse2, response.json()) + deserialized = _deserialize(_models.GetResponse7, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1755,11 +1755,11 @@ def __init__(self, *args, **kwargs): self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - def get(self, **kwargs: Any) -> _models.GetResponse1: + def get(self, **kwargs: Any) -> _models.GetResponse8: """get. - :return: GetResponse1. The GetResponse1 is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse1 + :return: GetResponse8. The GetResponse8 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse8 :raises ~corehttp.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1773,7 +1773,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse1: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse1] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse8] = kwargs.pop("cls", None) _request = build_mixed_literals_get_request( headers=_headers, @@ -1801,7 +1801,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse1: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse1, response.json()) + deserialized = _deserialize(_models.GetResponse8, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -1930,11 +1930,11 @@ def __init__(self, *args, **kwargs): self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - def get(self, **kwargs: Any) -> _models.GetResponse: + def get(self, **kwargs: Any) -> _models.GetResponse9: """get. - :return: GetResponse. The GetResponse is compatible with MutableMapping - :rtype: ~typetest.union.models.GetResponse + :return: GetResponse9. The GetResponse9 is compatible with MutableMapping + :rtype: ~typetest.union.models.GetResponse9 :raises ~corehttp.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -1948,7 +1948,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse: _headers = kwargs.pop("headers", {}) or {} _params = kwargs.pop("params", {}) or {} - cls: ClsType[_models.GetResponse] = kwargs.pop("cls", None) + cls: ClsType[_models.GetResponse9] = kwargs.pop("cls", None) _request = build_mixed_types_get_request( headers=_headers, @@ -1976,7 +1976,7 @@ def get(self, **kwargs: Any) -> _models.GetResponse: if _stream: deserialized = response.iter_bytes() else: - deserialized = _deserialize(_models.GetResponse, response.json()) + deserialized = _deserialize(_models.GetResponse9, response.json()) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore From 71727a6797e72162cb46a0956c9d30f20fc3d0b1 Mon Sep 17 00:00:00 2001 From: AutoPrFromHttpClientPython Date: Thu, 3 Apr 2025 04:19:59 +0000 Subject: [PATCH 17/19] Update dependencies (2025-04-03 04:19:59) --- packages/autorest.python/package.json | 2 +- packages/typespec-python/package.json | 18 ++++++++-------- pnpm-lock.yaml | 30 +++++++++++++-------------- 3 files changed, 25 insertions(+), 25 deletions(-) diff --git a/packages/autorest.python/package.json b/packages/autorest.python/package.json index 8489bbf7a5f..1e98a132910 100644 --- a/packages/autorest.python/package.json +++ b/packages/autorest.python/package.json @@ -29,7 +29,7 @@ }, "homepage": "https://github.com/Azure/autorest.python/blob/main/README.md", "dependencies": { - "@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcxNzQ4OS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.9.0.tgz", + "@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcxNzYyMS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.9.0.tgz", "@autorest/system-requirements": "~1.0.2", "fs-extra": "~11.2.0", "tsx": "~4.19.1" diff --git a/packages/typespec-python/package.json b/packages/typespec-python/package.json index c6e5ba8ec19..7599616f194 100644 --- a/packages/typespec-python/package.json +++ b/packages/typespec-python/package.json @@ -45,26 +45,26 @@ "generator/**" ], "peerDependencies": { - "@typespec/compiler": ">=1.0.0-0 <2.0.0", - "@typespec/http": ">=1.0.0-0 <2.0.0", + "@typespec/compiler": "^1.0.0-0", + "@typespec/http": "^1.0.0-0", "@typespec/rest": ">=0.68.0 <1.0.0", "@typespec/versioning": ">=0.68.0 <1.0.0", - "@typespec/openapi": ">=1.0.0-0 <2.0.0", + "@typespec/openapi": "^1.0.0-0", "@typespec/events": ">=0.68.0 <1.0.0", "@typespec/sse": ">=0.68.0 <1.0.0", "@typespec/streams": ">=0.68.0 <1.0.0", "@typespec/xml": ">=0.68.0 <1.0.0", - "@azure-tools/typespec-azure-core": ">= 0.54.0 <1.0.0", - "@azure-tools/typespec-azure-resource-manager": ">= 0.54.0 <1.0.0", - "@azure-tools/typespec-autorest": ">= 0.54.0 <1.0.0", - "@azure-tools/typespec-azure-rulesets": ">= 0.54.0 <1.0.0", - "@azure-tools/typespec-client-generator-core": ">= 0.54.0 <1.0.0" + "@azure-tools/typespec-azure-core": ">=0.54.0 <1.0.0", + "@azure-tools/typespec-azure-resource-manager": ">=0.54.0 <1.0.0", + "@azure-tools/typespec-autorest": ">=0.54.0 <1.0.0", + "@azure-tools/typespec-azure-rulesets": ">=0.54.0 <1.0.0", + "@azure-tools/typespec-client-generator-core": ">=0.54.0 <1.0.0" }, "dependencies": { "js-yaml": "~4.1.0", "semver": "~7.6.2", "tsx": "~4.19.1", - "@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcxNzQ4OS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.9.0.tgz", + "@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcxNzYyMS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.9.0.tgz", "fs-extra": "~11.2.0" }, "devDependencies": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f5175ccaa40..3fc84c26af4 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -57,8 +57,8 @@ importers: specifier: ~1.0.2 version: 1.0.2 '@typespec/http-client-python': - specifier: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcxNzQ4OS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.9.0.tgz - version: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcxNzQ4OS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.9.0.tgz(2ivfmxvrftapo7cbuxsaae6yq4) + specifier: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcxNzYyMS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.9.0.tgz + version: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcxNzYyMS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.9.0.tgz(2ivfmxvrftapo7cbuxsaae6yq4) fs-extra: specifier: ~11.2.0 version: 11.2.0 @@ -79,8 +79,8 @@ importers: packages/typespec-python: dependencies: '@typespec/http-client-python': - specifier: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcxNzQ4OS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.9.0.tgz - version: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcxNzQ4OS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.9.0.tgz(2ivfmxvrftapo7cbuxsaae6yq4) + specifier: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcxNzYyMS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.9.0.tgz + version: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcxNzYyMS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.9.0.tgz(2ivfmxvrftapo7cbuxsaae6yq4) fs-extra: specifier: ~11.2.0 version: 11.2.0 @@ -1538,20 +1538,20 @@ packages: peerDependencies: '@typespec/compiler': ^1.0.0-rc.0 - '@typespec/http-client-python@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcxNzQ4OS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.9.0.tgz': - resolution: {tarball: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcxNzQ4OS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.9.0.tgz} + '@typespec/http-client-python@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcxNzYyMS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.9.0.tgz': + resolution: {tarball: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcxNzYyMS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.9.0.tgz} version: 0.9.0 engines: {node: '>=20.0.0'} peerDependencies: - '@azure-tools/typespec-autorest': '>= 0.54.0 <1.0.0' - '@azure-tools/typespec-azure-core': '>= 0.54.0 <1.0.0' - '@azure-tools/typespec-azure-resource-manager': '>= 0.54.0 <1.0.0' - '@azure-tools/typespec-azure-rulesets': '>= 0.54.0 <1.0.0' - '@azure-tools/typespec-client-generator-core': '>= 0.54.0 <1.0.0' - '@typespec/compiler': '>=1.0.0-0 <2.0.0' + '@azure-tools/typespec-autorest': '>=0.54.0 <1.0.0' + '@azure-tools/typespec-azure-core': '>=0.54.0 <1.0.0' + '@azure-tools/typespec-azure-resource-manager': '>=0.54.0 <1.0.0' + '@azure-tools/typespec-azure-rulesets': '>=0.54.0 <1.0.0' + '@azure-tools/typespec-client-generator-core': '>=0.54.0 <1.0.0' + '@typespec/compiler': ^1.0.0-0 '@typespec/events': '>=0.68.0 <1.0.0' - '@typespec/http': '>=1.0.0-0 <2.0.0' - '@typespec/openapi': '>=1.0.0-0 <2.0.0' + '@typespec/http': ^1.0.0-0 + '@typespec/openapi': ^1.0.0-0 '@typespec/rest': '>=0.68.0 <1.0.0' '@typespec/sse': '>=0.68.0 <1.0.0' '@typespec/streams': '>=0.68.0 <1.0.0' @@ -5894,7 +5894,7 @@ snapshots: dependencies: '@typespec/compiler': 1.0.0-rc.0(@types/node@22.13.17) - '@typespec/http-client-python@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcxNzQ4OS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.9.0.tgz(2ivfmxvrftapo7cbuxsaae6yq4)': + '@typespec/http-client-python@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcxNzYyMS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.9.0.tgz(2ivfmxvrftapo7cbuxsaae6yq4)': dependencies: '@azure-tools/typespec-autorest': 0.54.0(eijwshhpe4ydfv4uxokr3dajqe) '@azure-tools/typespec-azure-core': 0.54.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/http@1.0.0-rc.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/streams@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))))(@typespec/rest@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/http@1.0.0-rc.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/streams@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))))) From 34885234515a00c6b8b8cfc10ea1f54bdaf800ef Mon Sep 17 00:00:00 2001 From: Yuchao Yan Date: Thu, 3 Apr 2025 04:51:54 +0000 Subject: [PATCH 18/19] add chagnelog --- .../auto-microsoft-python-auth-flow-2025-2-31-14-16-3.md | 8 -------- .../auto-microsoft-python_license-2025-2-27-11-8-0.md | 8 -------- .chronus/changes/upgrade-pyright-2025-2-27-11-12-41.md | 7 ------- packages/autorest.python/CHANGELOG.md | 8 ++++++++ packages/autorest.python/package.json | 4 ++-- packages/typespec-python/CHANGELOG.md | 8 ++++++++ packages/typespec-python/package.json | 4 ++-- 7 files changed, 20 insertions(+), 27 deletions(-) delete mode 100644 .chronus/changes/auto-microsoft-python-auth-flow-2025-2-31-14-16-3.md delete mode 100644 .chronus/changes/auto-microsoft-python_license-2025-2-27-11-8-0.md delete mode 100644 .chronus/changes/upgrade-pyright-2025-2-27-11-12-41.md diff --git a/.chronus/changes/auto-microsoft-python-auth-flow-2025-2-31-14-16-3.md b/.chronus/changes/auto-microsoft-python-auth-flow-2025-2-31-14-16-3.md deleted file mode 100644 index 5fb9fab0f82..00000000000 --- a/.chronus/changes/auto-microsoft-python-auth-flow-2025-2-31-14-16-3.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -changeKind: feature -packages: - - "@autorest/python" - - "@azure-tools/typespec-python" ---- - -Pass authentication flows info into credential policy for unbranded \ No newline at end of file diff --git a/.chronus/changes/auto-microsoft-python_license-2025-2-27-11-8-0.md b/.chronus/changes/auto-microsoft-python_license-2025-2-27-11-8-0.md deleted file mode 100644 index 90f50cda20a..00000000000 --- a/.chronus/changes/auto-microsoft-python_license-2025-2-27-11-8-0.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -changeKind: feature -packages: - - "@autorest/python" - - "@azure-tools/typespec-python" ---- - -support typespec license config \ No newline at end of file diff --git a/.chronus/changes/upgrade-pyright-2025-2-27-11-12-41.md b/.chronus/changes/upgrade-pyright-2025-2-27-11-12-41.md deleted file mode 100644 index 10b39bb1f61..00000000000 --- a/.chronus/changes/upgrade-pyright-2025-2-27-11-12-41.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -changeKind: internal -packages: - - "@azure-tools/typespec-python" ---- - -Upgrade pyright version \ No newline at end of file diff --git a/packages/autorest.python/CHANGELOG.md b/packages/autorest.python/CHANGELOG.md index e2ea225b5cf..be184a7e07d 100644 --- a/packages/autorest.python/CHANGELOG.md +++ b/packages/autorest.python/CHANGELOG.md @@ -1,5 +1,13 @@ # Release +## 6.32.0 + +### Features + +- [#3062](https://github.com/Azure/autorest.python/pull/3062) Pass authentication flows info into credential policy for unbranded +- [#3061](https://github.com/Azure/autorest.python/pull/3061) support typespec license config + + ## 6.31.0 ### Features diff --git a/packages/autorest.python/package.json b/packages/autorest.python/package.json index 1e98a132910..1e215bc376f 100644 --- a/packages/autorest.python/package.json +++ b/packages/autorest.python/package.json @@ -1,6 +1,6 @@ { "name": "@autorest/python", - "version": "6.31.0", + "version": "6.32.0", "description": "The Python extension for generators in AutoRest.", "scripts": { "start": "node ./scripts/run-python3.js ./scripts/start.py", @@ -47,4 +47,4 @@ "requirements.txt", "generator/" ] -} \ No newline at end of file +} diff --git a/packages/typespec-python/CHANGELOG.md b/packages/typespec-python/CHANGELOG.md index 1a7261816fb..063cf5906fd 100644 --- a/packages/typespec-python/CHANGELOG.md +++ b/packages/typespec-python/CHANGELOG.md @@ -1,5 +1,13 @@ # Release +## 0.42.0 + +### Features + +- [#3062](https://github.com/Azure/autorest.python/pull/3062) Pass authentication flows info into credential policy for unbranded +- [#3061](https://github.com/Azure/autorest.python/pull/3061) support typespec license config + + ## 0.41.0 ### Features diff --git a/packages/typespec-python/package.json b/packages/typespec-python/package.json index 7599616f194..32a2f638637 100644 --- a/packages/typespec-python/package.json +++ b/packages/typespec-python/package.json @@ -1,6 +1,6 @@ { "name": "@azure-tools/typespec-python", - "version": "0.41.0", + "version": "0.42.0", "author": "Microsoft Corporation", "description": "TypeSpec emitter for Python SDKs", "homepage": "https://github.com/Azure/autorest.python", @@ -97,4 +97,4 @@ "chalk": "5.3.0", "@types/fs-extra": "11.0.4" } -} \ No newline at end of file +} From b6b282f848336a519836527de1856653118722b0 Mon Sep 17 00:00:00 2001 From: Yuchao Yan Date: Thu, 3 Apr 2025 06:19:22 +0000 Subject: [PATCH 19/19] update dep --- packages/autorest.python/package.json | 2 +- packages/typespec-python/package.json | 2 +- pnpm-lock.yaml | 15 +++++++-------- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/packages/autorest.python/package.json b/packages/autorest.python/package.json index 1e215bc376f..63ddb26cee8 100644 --- a/packages/autorest.python/package.json +++ b/packages/autorest.python/package.json @@ -29,7 +29,7 @@ }, "homepage": "https://github.com/Azure/autorest.python/blob/main/README.md", "dependencies": { - "@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcxNzYyMS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.9.0.tgz", + "@typespec/http-client-python": "~0.9.0", "@autorest/system-requirements": "~1.0.2", "fs-extra": "~11.2.0", "tsx": "~4.19.1" diff --git a/packages/typespec-python/package.json b/packages/typespec-python/package.json index 32a2f638637..ed36ce48743 100644 --- a/packages/typespec-python/package.json +++ b/packages/typespec-python/package.json @@ -64,7 +64,7 @@ "js-yaml": "~4.1.0", "semver": "~7.6.2", "tsx": "~4.19.1", - "@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcxNzYyMS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.9.0.tgz", + "@typespec/http-client-python": "~0.9.0", "fs-extra": "~11.2.0" }, "devDependencies": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3fc84c26af4..260b0e984de 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -57,8 +57,8 @@ importers: specifier: ~1.0.2 version: 1.0.2 '@typespec/http-client-python': - specifier: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcxNzYyMS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.9.0.tgz - version: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcxNzYyMS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.9.0.tgz(2ivfmxvrftapo7cbuxsaae6yq4) + specifier: ~0.9.0 + version: 0.9.0(2ivfmxvrftapo7cbuxsaae6yq4) fs-extra: specifier: ~11.2.0 version: 11.2.0 @@ -79,8 +79,8 @@ importers: packages/typespec-python: dependencies: '@typespec/http-client-python': - specifier: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcxNzYyMS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.9.0.tgz - version: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcxNzYyMS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.9.0.tgz(2ivfmxvrftapo7cbuxsaae6yq4) + specifier: ~0.9.0 + version: 0.9.0(2ivfmxvrftapo7cbuxsaae6yq4) fs-extra: specifier: ~11.2.0 version: 11.2.0 @@ -1538,9 +1538,8 @@ packages: peerDependencies: '@typespec/compiler': ^1.0.0-rc.0 - '@typespec/http-client-python@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcxNzYyMS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.9.0.tgz': - resolution: {tarball: https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcxNzYyMS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.9.0.tgz} - version: 0.9.0 + '@typespec/http-client-python@0.9.0': + resolution: {integrity: sha512-4gAC9ht4LwZ0eyBgCT94emckysHSd/MNfX96yaVvdZze5xN3LyVdh0BWg6Gn/C6/tGm4ECrdPBZJT/mqI/IXbw==} engines: {node: '>=20.0.0'} peerDependencies: '@azure-tools/typespec-autorest': '>=0.54.0 <1.0.0' @@ -5894,7 +5893,7 @@ snapshots: dependencies: '@typespec/compiler': 1.0.0-rc.0(@types/node@22.13.17) - '@typespec/http-client-python@https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDcxNzYyMS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.9.0.tgz(2ivfmxvrftapo7cbuxsaae6yq4)': + '@typespec/http-client-python@0.9.0(2ivfmxvrftapo7cbuxsaae6yq4)': dependencies: '@azure-tools/typespec-autorest': 0.54.0(eijwshhpe4ydfv4uxokr3dajqe) '@azure-tools/typespec-azure-core': 0.54.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/http@1.0.0-rc.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/streams@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))))(@typespec/rest@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/http@1.0.0-rc.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17))(@typespec/streams@0.68.0(@typespec/compiler@1.0.0-rc.0(@types/node@22.13.17)))))