diff --git a/.vscode/launch.json b/.vscode/launch.json index 54c56e89d9..d268934228 100755 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -160,7 +160,7 @@ "cwd": "${workspaceFolder}/packages/typespec-ts", "runtimeArgs": [ "cross-env", - "TS_NODE_PROJECT=tsconfig.test.json", + "TS_NODE_PROJECT=tsconfig.integration.json", "mocha", "-r", "ts-node/register", diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 7ca474c237..c9f30b812c 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -193,34 +193,32 @@ importers: ../../packages/typespec-test: specifiers: - '@azure-tools/typespec-autorest': '>=0.34.0 <1.0.0' - '@azure-tools/typespec-azure-core': '>=0.34.0 <1.0.0' - '@azure-tools/typespec-client-generator-core': 0.35.0-dev.9 + '@azure-tools/typespec-autorest': '>=0.35.0 <1.0.0' + '@azure-tools/typespec-azure-core': '>=0.35.0 <1.0.0' + '@azure-tools/typespec-client-generator-core': '>=0.35.0 <1.0.0' '@azure-tools/typespec-ts': workspace:^0.17.1 '@types/mocha': ^5.2.7 '@types/node': ^18.0.0 - '@typespec/compiler': '>=0.48.0 <1.0.0' - '@typespec/http': '>=0.48.0 <1.0.0' - '@typespec/openapi': '>=0.48.0 <1.0.0' - '@typespec/openapi3': '>=0.48.0 <1.0.0' - '@typespec/prettier-plugin-typespec': '>=0.48.0 <1.0.0' - '@typespec/rest': '>=0.48.0 <1.0.0' - '@typespec/versioning': '>=0.48.0 <1.0.0' + '@typespec/compiler': '>=0.49.0 <1.0.0' + '@typespec/http': '>=0.49.0 <1.0.0' + '@typespec/openapi': '>=0.49.0 <1.0.0' + '@typespec/openapi3': '>=0.49.0 <1.0.0' + '@typespec/rest': '>=0.49.0 <1.0.0' + '@typespec/versioning': '>=0.49.0 <1.0.0' prettier: 2.7.1 ts-node: ^8.5.2 typescript: ~5.2.0 dependencies: - '@azure-tools/typespec-autorest': 0.34.0_nxx2fgud4m37o2sshjer4jjwwq - '@azure-tools/typespec-azure-core': 0.34.0_rrr67ktvtl5sjmdurmdq3vcwqa - '@azure-tools/typespec-client-generator-core': 0.35.0-dev.9_vjfuylwjy63akxo42b2aelnak4 + '@azure-tools/typespec-autorest': 0.35.0_pkfpij76ovuapidkpvq426hebu + '@azure-tools/typespec-azure-core': 0.35.0_l2k6cauhiswc7cyef3ltb45dhy + '@azure-tools/typespec-client-generator-core': 0.35.0_hyg5yyh7beodvmafzqxellnzky '@azure-tools/typespec-ts': link:../typespec-ts - '@typespec/compiler': 0.48.1 - '@typespec/http': 0.48.0_@typespec+compiler@0.48.1 - '@typespec/openapi': 0.48.0_rrr67ktvtl5sjmdurmdq3vcwqa - '@typespec/openapi3': 0.48.1_xov64jfu5fh4fuj2luossx4gtu - '@typespec/prettier-plugin-typespec': 0.48.0 - '@typespec/rest': 0.48.0_@typespec+compiler@0.48.1 - '@typespec/versioning': 0.48.0_@typespec+compiler@0.48.1 + '@typespec/compiler': 0.49.0 + '@typespec/http': 0.49.0_@typespec+compiler@0.49.0 + '@typespec/openapi': 0.49.0_eeytn2g3ek3zpawg2doqsgnp3y + '@typespec/openapi3': 0.49.0_kxluj4hvpeoa2fuoepu73vvsjm + '@typespec/rest': 0.49.0_eeytn2g3ek3zpawg2doqsgnp3y + '@typespec/versioning': 0.49.0_@typespec+compiler@0.49.0 prettier: 2.7.1 devDependencies: '@types/mocha': 5.2.7 @@ -231,12 +229,12 @@ importers: ../../packages/typespec-ts: specifiers: '@azure-rest/core-client': ^1.1.4 - '@azure-tools/cadl-ranch': ^0.8.2 - '@azure-tools/cadl-ranch-expect': ^0.7.0 - '@azure-tools/cadl-ranch-specs': ^0.22.2 + '@azure-tools/cadl-ranch': ^0.9.0 + '@azure-tools/cadl-ranch-expect': ^0.8.0 + '@azure-tools/cadl-ranch-specs': ^0.24.0 '@azure-tools/rlc-common': workspace:^0.17.1 - '@azure-tools/typespec-azure-core': '>=0.34.0 <1.0.0' - '@azure-tools/typespec-client-generator-core': 0.35.0-dev.9 + '@azure-tools/typespec-azure-core': '>=0.35.0 <1.0.0' + '@azure-tools/typespec-client-generator-core': '>=0.35.0 <1.0.0' '@azure/core-auth': ^1.3.2 '@azure/core-lro': ^2.5.4 '@azure/core-paging': ^1.5.0 @@ -250,10 +248,10 @@ importers: '@types/prettier': ^2.6.0 '@typescript-eslint/eslint-plugin': ^5.58.0 '@typescript-eslint/parser': ^5.58.0 - '@typespec/compiler': '>=0.48.0 <1.0.0' - '@typespec/http': '>=0.48.0 <1.0.0' - '@typespec/rest': '>=0.48.0 <1.0.0' - '@typespec/versioning': '>=0.48.0 <1.0.0' + '@typespec/compiler': '>=0.49.0 <1.0.0' + '@typespec/http': '>=0.49.0 <1.0.0' + '@typespec/rest': '>=0.49.0 <1.0.0' + '@typespec/versioning': '>=0.49.0 <1.0.0' chai: ^4.3.6 chalk: ^4.0.0 cross-env: ^7.0.3 @@ -270,21 +268,21 @@ importers: typescript: ~5.2.0 dependencies: '@azure-tools/rlc-common': link:../rlc-common - '@azure-tools/typespec-azure-core': 0.34.0_rrr67ktvtl5sjmdurmdq3vcwqa - '@azure-tools/typespec-client-generator-core': 0.35.0-dev.9_vjfuylwjy63akxo42b2aelnak4 - '@typespec/compiler': 0.48.1 - '@typespec/http': 0.48.0_@typespec+compiler@0.48.1 - '@typespec/rest': 0.48.0_@typespec+compiler@0.48.1 - '@typespec/versioning': 0.48.0_@typespec+compiler@0.48.1 + '@azure-tools/typespec-azure-core': 0.35.0_l2k6cauhiswc7cyef3ltb45dhy + '@azure-tools/typespec-client-generator-core': 0.35.0_hyg5yyh7beodvmafzqxellnzky + '@typespec/compiler': 0.49.0 + '@typespec/http': 0.49.0_@typespec+compiler@0.49.0 + '@typespec/rest': 0.49.0_eeytn2g3ek3zpawg2doqsgnp3y + '@typespec/versioning': 0.49.0_@typespec+compiler@0.49.0 fs-extra: 11.1.1 prettier: 2.7.1 ts-morph: 15.1.0 tslib: 2.6.2 devDependencies: '@azure-rest/core-client': 1.1.4 - '@azure-tools/cadl-ranch': 0.8.2_7jjucimetrv3zkc4qdajxl7ram - '@azure-tools/cadl-ranch-expect': 0.7.0_vjfuylwjy63akxo42b2aelnak4 - '@azure-tools/cadl-ranch-specs': 0.22.2_luwdjmvswbfere7ah3i2jqa22q + '@azure-tools/cadl-ranch': 0.9.0_tezp5rjfyokhpujhigtdeqwzp4 + '@azure-tools/cadl-ranch-expect': 0.8.0_hyg5yyh7beodvmafzqxellnzky + '@azure-tools/cadl-ranch-specs': 0.24.0_o47dwcig7y553a2ndtr7sutngq '@azure/core-auth': 1.5.0 '@azure/core-lro': 2.5.4 '@azure/core-paging': 1.5.0 @@ -358,8 +356,8 @@ packages: proper-lockfile: 2.0.1 dev: false - /@azure-tools/cadl-ranch-api/0.4.0: - resolution: {integrity: sha512-RFyxrRlIPH9qB+j0UoK6ZvoLwfVjOVief7lv8qUtXeZr+FfyOd7TXe6BnmY9DLTcGXgw3AIxziQhPPwjRhfxDw==} + /@azure-tools/cadl-ranch-api/0.4.1: + resolution: {integrity: sha512-SzwNRh1hSv3KegsfFhdjGOtHrB5But7Znr73umAeTOpLGp9zfq18VU4dUgjDbYFoJ1swVa36lZ/1W3qOOBo4BQ==} engines: {node: '>=16.0.0'} dependencies: body-parser: 1.20.2 @@ -375,8 +373,8 @@ packages: - '@types/express' dev: true - /@azure-tools/cadl-ranch-coverage-sdk/0.3.0: - resolution: {integrity: sha512-p+nZq84e9supNZIgSGJTt5I4eoErWUmJEm1rObRN/ITYVluM/7gsmiqoox0+Vtac3KKpYto2hEejyTdwjkQaaw==} + /@azure-tools/cadl-ranch-coverage-sdk/0.4.0: + resolution: {integrity: sha512-hK6xVcVacJeuXQB18gEc8+oaHXzHDoFv5rGHoTHagBajOZfgf0vwPdMYUkWH+YLtZadtn0MJP8AOVYnwmqeAyg==} engines: {node: '>=16.0.0'} dependencies: '@azure/identity': 3.3.0 @@ -387,59 +385,59 @@ packages: - supports-color dev: true - /@azure-tools/cadl-ranch-expect/0.7.0_vjfuylwjy63akxo42b2aelnak4: - resolution: {integrity: sha512-rRWA6NYc+aZtX6YzpEx7R7wv20Eqenyp5PMLKQhmCUc86rC/H9GgEBVOlNKIom+bLewV2gTQbyYhBjYdnns+mA==} + /@azure-tools/cadl-ranch-expect/0.8.0_hyg5yyh7beodvmafzqxellnzky: + resolution: {integrity: sha512-BjyiGorzaq7ejerrEgK4AiDrBgun5A/Q3U7kEGpK+lpjxON4nHkut07DnDqp3uEvxeHp4yZUIOX9MHd+nDPOPg==} engines: {node: '>=16.0.0'} peerDependencies: - '@typespec/compiler': ~0.48.0 - '@typespec/http': ~0.48.0 - '@typespec/rest': ~0.48.0 - '@typespec/versioning': ~0.48.0 + '@typespec/compiler': ~0.49.0 + '@typespec/http': ~0.49.0 + '@typespec/rest': ~0.49.0 + '@typespec/versioning': ~0.49.0 dependencies: - '@typespec/compiler': 0.48.1 - '@typespec/http': 0.48.0_@typespec+compiler@0.48.1 - '@typespec/rest': 0.48.0_@typespec+compiler@0.48.1 - '@typespec/versioning': 0.48.0_@typespec+compiler@0.48.1 + '@typespec/compiler': 0.49.0 + '@typespec/http': 0.49.0_@typespec+compiler@0.49.0 + '@typespec/rest': 0.49.0_eeytn2g3ek3zpawg2doqsgnp3y + '@typespec/versioning': 0.49.0_@typespec+compiler@0.49.0 dev: true - /@azure-tools/cadl-ranch-specs/0.22.2_luwdjmvswbfere7ah3i2jqa22q: - resolution: {integrity: sha512-H+vCAjx/G+ePsuRmZCRdsHeAj04mH9yzFQGKocpyq2kfsUm9G8RAoOTx+OmodMQ5QdqRluieP4p48otz0tDlRA==} + /@azure-tools/cadl-ranch-specs/0.24.0_o47dwcig7y553a2ndtr7sutngq: + resolution: {integrity: sha512-60gcPbnh1JMoE7IGJyXVfX6SRM/X4hE+fHzRc0oe64/GuRJuNS9Xzi8pwOqmoCJDQU1Y2O0y0H0fDHtEJdL6Sg==} engines: {node: '>=16.0.0'} peerDependencies: - '@azure-tools/cadl-ranch-expect': ~0.7.0 - '@azure-tools/typespec-azure-core': ~0.34.0 - '@typespec/compiler': ~0.48.0 - '@typespec/http': ~0.48.0 - '@typespec/rest': ~0.48.0 - '@typespec/versioning': ~0.48.0 - dependencies: - '@azure-tools/cadl-ranch': 0.8.2_7jjucimetrv3zkc4qdajxl7ram - '@azure-tools/cadl-ranch-api': 0.4.0 - '@azure-tools/cadl-ranch-expect': 0.7.0_vjfuylwjy63akxo42b2aelnak4 - '@azure-tools/typespec-azure-core': 0.34.0_rrr67ktvtl5sjmdurmdq3vcwqa - '@typespec/compiler': 0.48.1 - '@typespec/http': 0.48.0_@typespec+compiler@0.48.1 - '@typespec/rest': 0.48.0_@typespec+compiler@0.48.1 - '@typespec/versioning': 0.48.0_@typespec+compiler@0.48.1 + '@azure-tools/cadl-ranch-expect': ~0.8.0 + '@azure-tools/typespec-azure-core': ~0.35.0 + '@typespec/compiler': ~0.49.0 + '@typespec/http': ~0.49.0 + '@typespec/rest': ~0.49.0 + '@typespec/versioning': ~0.49.0 + dependencies: + '@azure-tools/cadl-ranch': 0.9.0_tezp5rjfyokhpujhigtdeqwzp4 + '@azure-tools/cadl-ranch-api': 0.4.1 + '@azure-tools/cadl-ranch-expect': 0.8.0_hyg5yyh7beodvmafzqxellnzky + '@azure-tools/typespec-azure-core': 0.35.0_l2k6cauhiswc7cyef3ltb45dhy + '@typespec/compiler': 0.49.0 + '@typespec/http': 0.49.0_@typespec+compiler@0.49.0 + '@typespec/rest': 0.49.0_eeytn2g3ek3zpawg2doqsgnp3y + '@typespec/versioning': 0.49.0_@typespec+compiler@0.49.0 transitivePeerDependencies: - '@types/express' - encoding - supports-color dev: true - /@azure-tools/cadl-ranch/0.8.2_7jjucimetrv3zkc4qdajxl7ram: - resolution: {integrity: sha512-HMrd1HzeB5qXvwpyRukv2+HjOOm9yJZYXAfFpd0M0vN9a2kUsw/km9SPC3pZVJfwjju5yWg4Hqk8ECCSpWGQkg==} + /@azure-tools/cadl-ranch/0.9.0_tezp5rjfyokhpujhigtdeqwzp4: + resolution: {integrity: sha512-EjY+NJ5DprIuVRrpNoTiJANcy5tqHQCRT7KVc3ry1kdQNhEMXV0VVSq8qDhyF60JRbfwMEv97nIpa743yUYW9w==} engines: {node: '>=16.0.0'} hasBin: true dependencies: - '@azure-tools/cadl-ranch-api': 0.4.0 - '@azure-tools/cadl-ranch-coverage-sdk': 0.3.0 - '@azure-tools/cadl-ranch-expect': 0.7.0_vjfuylwjy63akxo42b2aelnak4 + '@azure-tools/cadl-ranch-api': 0.4.1 + '@azure-tools/cadl-ranch-coverage-sdk': 0.4.0 + '@azure-tools/cadl-ranch-expect': 0.8.0_hyg5yyh7beodvmafzqxellnzky '@azure/identity': 3.3.0 '@types/js-yaml': 4.0.6 - '@typespec/compiler': 0.48.1 - '@typespec/http': 0.48.0_@typespec+compiler@0.48.1 - '@typespec/rest': 0.48.0_@typespec+compiler@0.48.1 + '@typespec/compiler': 0.49.0 + '@typespec/http': 0.49.0_@typespec+compiler@0.49.0 + '@typespec/rest': 0.49.0_eeytn2g3ek3zpawg2doqsgnp3y ajv: 8.12.0 body-parser: 1.20.2 deep-equal: 2.2.2 @@ -451,7 +449,6 @@ packages: morgan: 1.10.0 node-fetch: 3.3.2 picocolors: 1.0.0 - prettier: 2.8.8 source-map-support: 0.5.21 winston: 3.10.0 xml2js: 0.5.0 @@ -489,51 +486,50 @@ packages: - supports-color dev: true - /@azure-tools/typespec-autorest/0.34.0_nxx2fgud4m37o2sshjer4jjwwq: - resolution: {integrity: sha512-Fr5obMJzBgVzeK7pKblUKx1o7+p+KT84C1n+yRqqMP1Rqkq7y09iW3Mj3GO0xgs9DR8yMalBgHhvWWvB9l4yDA==} + /@azure-tools/typespec-autorest/0.35.0_pkfpij76ovuapidkpvq426hebu: + resolution: {integrity: sha512-UGiRhgyBc3WWEUgIsSaT44Jgbw6KD2DwYNDr6Oxl2Ig/8ZIInpIB5Eix7mgdqKoN6ifra1wLn0GDAltwVx+idQ==} engines: {node: '>=16.0.0'} peerDependencies: - '@azure-tools/typespec-azure-core': ~0.34.0 - '@typespec/compiler': ~0.48.0 - '@typespec/http': ~0.48.0 - '@typespec/openapi': ~0.48.0 - '@typespec/rest': ~0.48.0 - '@typespec/versioning': ~0.48.0 - dependencies: - '@azure-tools/typespec-azure-core': 0.34.0_rrr67ktvtl5sjmdurmdq3vcwqa - '@typespec/compiler': 0.48.1 - '@typespec/http': 0.48.0_@typespec+compiler@0.48.1 - '@typespec/openapi': 0.48.0_rrr67ktvtl5sjmdurmdq3vcwqa - '@typespec/rest': 0.48.0_@typespec+compiler@0.48.1 - '@typespec/versioning': 0.48.0_@typespec+compiler@0.48.1 + '@azure-tools/typespec-azure-core': ~0.35.0 + '@typespec/compiler': ~0.49.0 + '@typespec/http': ~0.49.0 + '@typespec/openapi': ~0.49.0 + '@typespec/rest': ~0.49.0 + '@typespec/versioning': ~0.49.0 + dependencies: + '@azure-tools/typespec-azure-core': 0.35.0_l2k6cauhiswc7cyef3ltb45dhy + '@typespec/compiler': 0.49.0 + '@typespec/http': 0.49.0_@typespec+compiler@0.49.0 + '@typespec/openapi': 0.49.0_eeytn2g3ek3zpawg2doqsgnp3y + '@typespec/rest': 0.49.0_eeytn2g3ek3zpawg2doqsgnp3y + '@typespec/versioning': 0.49.0_@typespec+compiler@0.49.0 dev: false - /@azure-tools/typespec-azure-core/0.34.0_rrr67ktvtl5sjmdurmdq3vcwqa: - resolution: {integrity: sha512-n3WrIx8bAHsknYXivbhl8WO+uzdB6RZMtx27/vnD+Jpo2krxLm0mMJK6pz2m/npTV4qlbY05OIeokhWQrneypw==} + /@azure-tools/typespec-azure-core/0.35.0_l2k6cauhiswc7cyef3ltb45dhy: + resolution: {integrity: sha512-BOzR58O6ZeMcvDD9D1gd9/kZvmJUlyXUiF0BSQUouNVWTlOL9yIMVKZE+zgTiaYm8a3z2uIU9Us6y8CULoWiyw==} engines: {node: '>=16.0.0'} peerDependencies: - '@typespec/compiler': ~0.48.0 - '@typespec/http': ~0.48.0 - '@typespec/rest': ~0.48.0 + '@typespec/compiler': ~0.49.0 + '@typespec/http': ~0.49.0 + '@typespec/rest': ~0.49.0 dependencies: - '@typespec/compiler': 0.48.1 - '@typespec/http': 0.48.0_@typespec+compiler@0.48.1 - '@typespec/rest': 0.48.0_@typespec+compiler@0.48.1 + '@typespec/compiler': 0.49.0 + '@typespec/http': 0.49.0_@typespec+compiler@0.49.0 + '@typespec/rest': 0.49.0_eeytn2g3ek3zpawg2doqsgnp3y - /@azure-tools/typespec-client-generator-core/0.35.0-dev.9_vjfuylwjy63akxo42b2aelnak4: - resolution: {integrity: sha512-pwFVaKBixTzXd1c/6MBMWdhBgK1Q7sQPXc8wcLsxZQ8iThu02tMc/qCQIvX6l6i7fIwOMvwEIhnRjyErsTzaug==} + /@azure-tools/typespec-client-generator-core/0.35.0_hyg5yyh7beodvmafzqxellnzky: + resolution: {integrity: sha512-3uItmYVhZVmPKCe+s8UZKAubUsjtTbgqVQI4wNayLuAovB9OrWmq09Wq1XEWFHPboGf+4Irehe/feTDnSHA+UA==} engines: {node: '>=16.0.0'} peerDependencies: - '@typespec/compiler': ~0.48.1 || >=0.49.0-dev <0.49.0 - '@typespec/http': ~0.48.0 || >=0.49.0-dev <0.49.0 - '@typespec/rest': ~0.48.0 || >=0.49.0-dev <0.49.0 - '@typespec/versioning': ~0.48.0 || >=0.49.0-dev <0.49.0 - dependencies: - '@typespec/compiler': 0.48.1 - '@typespec/http': 0.48.0_@typespec+compiler@0.48.1 - '@typespec/lint': 0.48.0_@typespec+compiler@0.48.1 - '@typespec/rest': 0.48.0_@typespec+compiler@0.48.1 - '@typespec/versioning': 0.48.0_@typespec+compiler@0.48.1 + '@typespec/compiler': ~0.49.0 + '@typespec/http': ~0.49.0 + '@typespec/rest': ~0.49.0 + '@typespec/versioning': ~0.49.0 + dependencies: + '@typespec/compiler': 0.49.0 + '@typespec/http': 0.49.0_@typespec+compiler@0.49.0 + '@typespec/rest': 0.49.0_eeytn2g3ek3zpawg2doqsgnp3y + '@typespec/versioning': 0.49.0_@typespec+compiler@0.49.0 dev: false /@azure/abort-controller/1.1.0: @@ -697,6 +693,7 @@ packages: /@azure/identity/3.3.0: resolution: {integrity: sha512-gISa/dAAxrWt6F2WiDXZY0y2xY4MLlN2wkNW4cPuq5OgPQKLSkxLc4I2WR04puTfZyQZnpXbAapAMEj1b96fgg==} engines: {node: '>=14.0.0'} + deprecated: Please upgrade to the latest version of this package to get necessary fixes dependencies: '@azure/abort-controller': 1.1.0 '@azure/core-auth': 1.5.0 @@ -1339,94 +1336,77 @@ packages: eslint-visitor-keys: 3.4.3 dev: true - /@typespec/compiler/0.48.1: - resolution: {integrity: sha512-Cakj/WvozqGy1spjPurz/sOrtv2wTT5AWayxalDvjsdp/cqqnfXMCvJnqRnqODi4Dc3qkH8gbZag1TV1sp7bBA==} + /@typespec/compiler/0.49.0: + resolution: {integrity: sha512-wu0BzCnG6K8GArO1Mo0UIAVvsGnip+Dce3uBuPcW6mGSAv6Y0NljWBHp8dAJNs+uv45wFWpdkZFQvjr3SNUDJw==} engines: {node: '>=16.0.0'} hasBin: true dependencies: '@babel/code-frame': 7.22.13 ajv: 8.12.0 change-case: 4.1.2 - globby: 13.1.4 + globby: 13.2.2 mustache: 4.2.0 picocolors: 1.0.0 prettier: 3.0.3 prompts: 2.4.2 semver: 7.5.4 - vscode-languageserver: 8.1.0 + vscode-languageserver: 9.0.1 vscode-languageserver-textdocument: 1.0.8 yaml: 2.3.2 yargs: 17.7.2 - /@typespec/http/0.48.0_@typespec+compiler@0.48.1: - resolution: {integrity: sha512-e+0Y0Ky71flUNZSRzCfoOm8XvXsSYGmQgB9VZFDbLl8mQlXwuTfib4tWrU531TCtZHMnylbXx2wAk5+3uC6b9g==} + /@typespec/http/0.49.0_@typespec+compiler@0.49.0: + resolution: {integrity: sha512-MvDJ0s7CjeA/nmutQ4PSTYOj0Gy+78PNd/xe4W5II5w4Kb32Q1vT/oWI2bVZ9G5MkTugKK9P6jmfzwY7EiHksg==} engines: {node: '>=16.0.0'} peerDependencies: - '@typespec/compiler': ~0.48.0 + '@typespec/compiler': ~0.49.0 dependencies: - '@typespec/compiler': 0.48.1 + '@typespec/compiler': 0.49.0 - /@typespec/lint/0.48.0_@typespec+compiler@0.48.1: - resolution: {integrity: sha512-hu08yLr8ORbdljqU+qf25+EqVQBDonpFiAWU9qaJ/2yTnKfdkXRbGSRuBYC17oMvJesLzyxVRwarpWPdBIMycw==} + /@typespec/openapi/0.49.0_eeytn2g3ek3zpawg2doqsgnp3y: + resolution: {integrity: sha512-2TQfnGKtiiKYD1eMiRAcEwDByaBf5WgvcIlLWpWJk/nmcKr6ZeOzUDj5V1fGiiY+/1sI0C0qGCz8PIxcvLa9kw==} engines: {node: '>=16.0.0'} peerDependencies: - '@typespec/compiler': ~0.48.0 + '@typespec/compiler': ~0.49.0 + '@typespec/http': ~0.49.0 dependencies: - '@typespec/compiler': 0.48.1 + '@typespec/compiler': 0.49.0 + '@typespec/http': 0.49.0_@typespec+compiler@0.49.0 dev: false - /@typespec/openapi/0.48.0_rrr67ktvtl5sjmdurmdq3vcwqa: - resolution: {integrity: sha512-KptMNQd/+olEetmNGend6jhMjnFa+Lrhw/M+HCP46HcKH/NDVA/RWtX/KcT4KjxJYrmTlRF9sz19/Efg7u02CA==} + /@typespec/openapi3/0.49.0_kxluj4hvpeoa2fuoepu73vvsjm: + resolution: {integrity: sha512-oim7MoDT6YzgYoFoTwppq4bUKkrq2w7BkMSuUDBniFDfW31W7aEkkIJYj6Q5S8dU3w0wQPkUQZVtJZjKjGPrdw==} engines: {node: '>=16.0.0'} peerDependencies: - '@typespec/compiler': ~0.48.0 - '@typespec/http': ~0.48.0 - '@typespec/rest': ~0.48.0 - dependencies: - '@typespec/compiler': 0.48.1 - '@typespec/http': 0.48.0_@typespec+compiler@0.48.1 - '@typespec/rest': 0.48.0_@typespec+compiler@0.48.1 - dev: false - - /@typespec/openapi3/0.48.1_xov64jfu5fh4fuj2luossx4gtu: - resolution: {integrity: sha512-EMsLUn9VBoFAxVMbxM4dK3bIt0tjub7Y28yEqVN7P8IDUpzm/sDE24ro7+DzojmjFv7mlAV6hhnPM49BDHYiXA==} - engines: {node: '>=16.0.0'} - peerDependencies: - '@typespec/compiler': ~0.48.1 - '@typespec/http': ~0.48.0 - '@typespec/openapi': ~0.48.0 - '@typespec/rest': ~0.48.0 - '@typespec/versioning': ~0.48.0 - dependencies: - '@typespec/compiler': 0.48.1 - '@typespec/http': 0.48.0_@typespec+compiler@0.48.1 - '@typespec/openapi': 0.48.0_rrr67ktvtl5sjmdurmdq3vcwqa - '@typespec/rest': 0.48.0_@typespec+compiler@0.48.1 - '@typespec/versioning': 0.48.0_@typespec+compiler@0.48.1 + '@typespec/compiler': ~0.49.0 + '@typespec/http': ~0.49.0 + '@typespec/openapi': ~0.49.0 + '@typespec/versioning': ~0.49.0 + dependencies: + '@typespec/compiler': 0.49.0 + '@typespec/http': 0.49.0_@typespec+compiler@0.49.0 + '@typespec/openapi': 0.49.0_eeytn2g3ek3zpawg2doqsgnp3y + '@typespec/versioning': 0.49.0_@typespec+compiler@0.49.0 yaml: 2.3.2 dev: false - /@typespec/prettier-plugin-typespec/0.48.0: - resolution: {integrity: sha512-GktQSZ0Rc3d7xQ/QnzqwFX9V0l91kCU12T18wQxYzn3kDIqhTT8aL2GFP8a74X2DcbOj+ksrb9EcTZukLPc3Tg==} - dependencies: - prettier: 3.0.3 - dev: false - - /@typespec/rest/0.48.0_@typespec+compiler@0.48.1: - resolution: {integrity: sha512-PM41o2a7qsTi6OIiCE53OB5uh+GTas8YObJjV5Z9JHYtHhQKVQaRHE72qoZQp3919vJNStXTdDEbIjzMIVt3Ow==} + /@typespec/rest/0.49.0_eeytn2g3ek3zpawg2doqsgnp3y: + resolution: {integrity: sha512-C5Ym3Dal5MzDkDIAzTekLsGtPDzRSC9cbiagq4LQfFtzfUPA8tJlJOnD8txTw/XIaFg0hvAPNgTZSa+xtiXskQ==} engines: {node: '>=16.0.0'} peerDependencies: - '@typespec/compiler': ~0.48.0 + '@typespec/compiler': ~0.49.0 + '@typespec/http': ~0.49.0 dependencies: - '@typespec/compiler': 0.48.1 + '@typespec/compiler': 0.49.0 + '@typespec/http': 0.49.0_@typespec+compiler@0.49.0 - /@typespec/versioning/0.48.0_@typespec+compiler@0.48.1: - resolution: {integrity: sha512-WF26vmMPwizhSnjX0ox23nbp7hthtB4cN/J5w1tlryXyp/BXySHoYsJEMK7fviSpj4WdreVXdM6wmRIG33zqig==} + /@typespec/versioning/0.49.0_@typespec+compiler@0.49.0: + resolution: {integrity: sha512-SuRcEB0yaD/wPwaXweIRr+lNDB4hgZwFxHi84y7De1xlntutRl+NeRgWd+K4yVS6tpyNHzcqK6Z7bBD30yQK/w==} engines: {node: '>=16.0.0'} peerDependencies: - '@typespec/compiler': ~0.48.0 + '@typespec/compiler': ~0.49.0 dependencies: - '@typespec/compiler': 0.48.1 + '@typespec/compiler': 0.49.0 /@ungap/promise-all-settled/1.1.2: resolution: {integrity: sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q==} @@ -3229,8 +3209,8 @@ packages: slash: 3.0.0 dev: true - /globby/13.1.4: - resolution: {integrity: sha512-iui/IiiW+QrJ1X1hKH5qwlMQyv34wJAYwH1vrf8b9kBA4sNiif3gKsMHa+BrdnOpEudWjpotfa7LrTzB1ERS/g==} + /globby/13.2.2: + resolution: {integrity: sha512-Y1zNGV+pzQdh7H39l9zgB4PJqjRNqydvdYCDG4HFXM4XuvSaQQlEc91IU1yALL8gUTDomgBAfz3XJdmUS+oo0w==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} dependencies: dir-glob: 3.0.1 @@ -4677,12 +4657,6 @@ packages: engines: {node: '>=10.13.0'} hasBin: true - /prettier/2.8.8: - resolution: {integrity: sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==} - engines: {node: '>=10.13.0'} - hasBin: true - dev: true - /prettier/3.0.3: resolution: {integrity: sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg==} engines: {node: '>=14'} @@ -5845,27 +5819,27 @@ packages: engines: {node: '>=4.0.0 || >=6.0.0'} dev: false - /vscode-jsonrpc/8.1.0: - resolution: {integrity: sha512-6TDy/abTQk+zDGYazgbIPc+4JoXdwC8NHU9Pbn4UJP1fehUyZmM4RHp5IthX7A6L5KS30PRui+j+tbbMMMafdw==} + /vscode-jsonrpc/8.2.0: + resolution: {integrity: sha512-C+r0eKJUIfiDIfwJhria30+TYWPtuHJXHtI7J0YlOmKAo7ogxP20T0zxB7HZQIFhIyvoBPwWskjxrvAtfjyZfA==} engines: {node: '>=14.0.0'} - /vscode-languageserver-protocol/3.17.3: - resolution: {integrity: sha512-924/h0AqsMtA5yK22GgMtCYiMdCOtWTSGgUOkgEDX+wk2b0x4sAfLiO4NxBxqbiVtz7K7/1/RgVrVI0NClZwqA==} + /vscode-languageserver-protocol/3.17.5: + resolution: {integrity: sha512-mb1bvRJN8SVznADSGWM9u/b07H7Ecg0I3OgXDuLdn307rl/J3A9YD6/eYOssqhecL27hK1IPZAsaqh00i/Jljg==} dependencies: - vscode-jsonrpc: 8.1.0 - vscode-languageserver-types: 3.17.3 + vscode-jsonrpc: 8.2.0 + vscode-languageserver-types: 3.17.5 /vscode-languageserver-textdocument/1.0.8: resolution: {integrity: sha512-1bonkGqQs5/fxGT5UchTgjGVnfysL0O8v1AYMBjqTbWQTFn721zaPGDYFkOKtfDgFiSgXM3KwaG3FMGfW4Ed9Q==} - /vscode-languageserver-types/3.17.3: - resolution: {integrity: sha512-SYU4z1dL0PyIMd4Vj8YOqFvHu7Hz/enbWtpfnVbJHU4Nd1YNYx8u0ennumc6h48GQNeOLxmwySmnADouT/AuZA==} + /vscode-languageserver-types/3.17.5: + resolution: {integrity: sha512-Ld1VelNuX9pdF39h2Hgaeb5hEZM2Z3jUrrMgWQAu82jMtZp7p3vJT3BzToKtZI7NgQssZje5o0zryOrhQvzQAg==} - /vscode-languageserver/8.1.0: - resolution: {integrity: sha512-eUt8f1z2N2IEUDBsKaNapkz7jl5QpskN2Y0G01T/ItMxBxw1fJwvtySGB9QMecatne8jFIWJGWI61dWjyTLQsw==} + /vscode-languageserver/9.0.1: + resolution: {integrity: sha512-woByF3PDpkHFUreUa7Hos7+pUWdeWMXRd26+ZX2A8cFx6v/JPTtd4/uN0/jB6XQHYaOlHbio03NTHCqrgG5n7g==} hasBin: true dependencies: - vscode-languageserver-protocol: 3.17.3 + vscode-languageserver-protocol: 3.17.5 /wait-port/0.2.14: resolution: {integrity: sha512-kIzjWcr6ykl7WFbZd0TMae8xovwqcqbx6FM9l+7agOgUByhzdjfzZBPK2CPufldTOMxbUivss//Sh9MFawmPRQ==} diff --git a/packages/typespec-test/package.json b/packages/typespec-test/package.json index b11c952a75..d75b169066 100644 --- a/packages/typespec-test/package.json +++ b/packages/typespec-test/package.json @@ -3,17 +3,16 @@ "version": "1.0.0", "type": "module", "dependencies": { - "@typespec/compiler": ">=0.48.0 <1.0.0", "@azure-tools/typespec-ts": "workspace:^0.17.1", - "@typespec/http": ">=0.48.0 <1.0.0", - "@typespec/rest": ">=0.48.0 <1.0.0", - "@typespec/openapi": ">=0.48.0 <1.0.0", - "@typespec/versioning": ">=0.48.0 <1.0.0", - "@azure-tools/typespec-azure-core": ">=0.34.0 <1.0.0", - "@azure-tools/typespec-autorest": ">=0.34.0 <1.0.0", - "@azure-tools/typespec-client-generator-core": "0.35.0-dev.9", - "@typespec/openapi3": ">=0.48.0 <1.0.0", - "@typespec/prettier-plugin-typespec": ">=0.48.0 <1.0.0", + "@typespec/openapi": ">=0.49.0 <1.0.0", + "@azure-tools/typespec-autorest": ">=0.35.0 <1.0.0", + "@typespec/openapi3": ">=0.49.0 <1.0.0", + "@azure-tools/typespec-azure-core": ">=0.35.0 <1.0.0", + "@azure-tools/typespec-client-generator-core": ">=0.35.0 <1.0.0", + "@typespec/compiler": ">=0.49.0 <1.0.0", + "@typespec/http": ">=0.49.0 <1.0.0", + "@typespec/rest": ">=0.49.0 <1.0.0", + "@typespec/versioning": ">=0.49.0 <1.0.0", "prettier": "2.7.1" }, "devDependencies": { diff --git a/packages/typespec-test/test/widget_dpg/generated/typespec-ts/sources/generated/src/api/operations.ts b/packages/typespec-test/test/widget_dpg/generated/typespec-ts/sources/generated/src/api/operations.ts index 0130df2a8b..f19058a4af 100644 --- a/packages/typespec-test/test/widget_dpg/generated/typespec-ts/sources/generated/src/api/operations.ts +++ b/packages/typespec-test/test/widget_dpg/generated/typespec-ts/sources/generated/src/api/operations.ts @@ -55,7 +55,7 @@ export async function _listWidgetsDeserialize( return (result.body ?? []).map((p) => ({ id: p["id"], weight: p["weight"], - color: p["color"], + color: p["color"] as any, })); } @@ -92,7 +92,7 @@ export async function _getWidgetDeserialize( return { id: result.body["id"], weight: result.body["weight"], - color: result.body["color"], + color: result.body["color"] as any, }; } @@ -129,7 +129,7 @@ export async function _createWidgetDeserialize( return { id: result.body["id"], weight: result.body["weight"], - color: result.body["color"], + color: result.body["color"] as any, }; } @@ -172,7 +172,7 @@ export async function _updateWidgetDeserialize( return { id: result.body["id"], weight: result.body["weight"], - color: result.body["color"], + color: result.body["color"] as any, }; } diff --git a/packages/typespec-test/test/widget_dpg/generated/typespec-ts/src/api/operations.ts b/packages/typespec-test/test/widget_dpg/generated/typespec-ts/src/api/operations.ts index 0130df2a8b..f19058a4af 100644 --- a/packages/typespec-test/test/widget_dpg/generated/typespec-ts/src/api/operations.ts +++ b/packages/typespec-test/test/widget_dpg/generated/typespec-ts/src/api/operations.ts @@ -55,7 +55,7 @@ export async function _listWidgetsDeserialize( return (result.body ?? []).map((p) => ({ id: p["id"], weight: p["weight"], - color: p["color"], + color: p["color"] as any, })); } @@ -92,7 +92,7 @@ export async function _getWidgetDeserialize( return { id: result.body["id"], weight: result.body["weight"], - color: result.body["color"], + color: result.body["color"] as any, }; } @@ -129,7 +129,7 @@ export async function _createWidgetDeserialize( return { id: result.body["id"], weight: result.body["weight"], - color: result.body["color"], + color: result.body["color"] as any, }; } @@ -172,7 +172,7 @@ export async function _updateWidgetDeserialize( return { id: result.body["id"], weight: result.body["weight"], - color: result.body["color"], + color: result.body["color"] as any, }; } diff --git a/packages/typespec-ts/package.json b/packages/typespec-ts/package.json index 68cc80581f..a7dd5ca5d5 100644 --- a/packages/typespec-ts/package.json +++ b/packages/typespec-ts/package.json @@ -52,9 +52,9 @@ "ts-node": "^10.9.1", "typescript": "~5.2.0", "prettier": "~2.7.1", - "@azure-tools/cadl-ranch-specs": "^0.22.2", - "@azure-tools/cadl-ranch-expect": "^0.7.0", - "@azure-tools/cadl-ranch": "^0.8.2", + "@azure-tools/cadl-ranch-specs": "^0.24.0", + "@azure-tools/cadl-ranch-expect": "^0.8.0", + "@azure-tools/cadl-ranch": "^0.9.0", "chalk": "^4.0.0", "@azure-rest/core-client": "^1.1.4", "@azure/core-auth": "^1.3.2", @@ -67,12 +67,12 @@ "eslint-plugin-require-extensions": "0.1.3" }, "peerDependencies": { - "@azure-tools/typespec-azure-core": ">=0.34.0 <1.0.0", - "@azure-tools/typespec-client-generator-core": "0.35.0-dev.9", - "@typespec/compiler": ">=0.48.0 <1.0.0", - "@typespec/http": ">=0.48.0 <1.0.0", - "@typespec/rest": ">=0.48.0 <1.0.0", - "@typespec/versioning": ">=0.48.0 <1.0.0" + "@azure-tools/typespec-azure-core": ">=0.35.0 <1.0.0", + "@azure-tools/typespec-client-generator-core": ">=0.35.0 <1.0.0", + "@typespec/compiler": ">=0.49.0 <1.0.0", + "@typespec/http": ">=0.49.0 <1.0.0", + "@typespec/rest": ">=0.49.0 <1.0.0", + "@typespec/versioning": ">=0.49.0 <1.0.0" }, "dependencies": { "prettier": "^2.6.1", diff --git a/packages/typespec-ts/src/transform/transformPaths.ts b/packages/typespec-ts/src/transform/transformPaths.ts index 387d8cd356..586b84b81b 100644 --- a/packages/typespec-ts/src/transform/transformPaths.ts +++ b/packages/typespec-ts/src/transform/transformPaths.ts @@ -6,15 +6,13 @@ import { getParameterTypeName, PathMetadata, Paths, - ResponseTypes, OperationMethod } from "@azure-tools/rlc-common"; import { getDoc, ignoreDiagnostics, Program } from "@typespec/compiler"; import { getHttpOperation, HttpOperation, - HttpOperationParameters, - HttpOperationResponse + HttpOperationParameters } from "@typespec/http"; import { SdkClient, @@ -25,12 +23,13 @@ import { import { getSchemaForType } from "../utils/modelUtils.js"; import { extractOperationLroDetail, + getOperationSuccessStatus, getOperationGroupName, getOperationName, + getOperationResponseTypes, getOperationStatuscode, - isDefaultStatusCode, - isDefinedStatusCode, - isPagingOperation + isPagingOperation, + sortedOperationResponses } from "../utils/operationUtil.js"; import { SdkContext } from "../utils/interfaces.js"; @@ -67,42 +66,6 @@ export function transformPaths( return paths; } -/** - * This function computes all the response types error and success - * an operation can end up returning. - */ -function getResponseTypes( - dpgContext: SdkContext, - operation: HttpOperation -): ResponseTypes { - const returnTypes: ResponseTypes = { - error: [], - success: [] - }; - function getResponseType(responses: HttpOperationResponse[]) { - return responses - .filter((r) => r.statusCode && r.statusCode.length) - .map((r) => { - const statusCode = getOperationStatuscode(r); - const responseName = getResponseTypeName( - getOperationGroupName(dpgContext, operation), - getOperationName(dpgContext.program, operation.operation), - statusCode - ); - return responseName; - }); - } - if (operation.responses && operation.responses.length) { - returnTypes.error = getResponseType( - operation.responses.filter((r) => isDefaultStatusCode(r.statusCode)) - ); - returnTypes.success = getResponseType( - operation.responses.filter((r) => isDefinedStatusCode(r.statusCode)) - ); - } - return returnTypes; -} - function transformOperation( dpgContext: SdkContext, route: HttpOperation, @@ -111,7 +74,7 @@ function transformOperation( const program = dpgContext.program; const respNames = []; const operationGroupName = getOperationGroupName(dpgContext, route); - for (const resp of route.responses) { + for (const resp of sortedOperationResponses(route.responses)) { const respName = getResponseTypeName( operationGroupName, getOperationName(program, route.operation), @@ -119,7 +82,7 @@ function transformOperation( ); respNames.push(respName); } - const responseTypes = getResponseTypes(dpgContext, route); + const responseTypes = getOperationResponseTypes(dpgContext, route); const method: OperationMethod = { description: getDoc(program, route.operation) ?? "", hasOptionalOptions: !hasRequiredOptions(dpgContext, route.parameters), @@ -129,7 +92,7 @@ function transformOperation( ), responseTypes, returnType: respNames.join(" | "), - successStatus: gerOperationSuccessStatus(route), + successStatus: getOperationSuccessStatus(route), operationName: getOperationName(program, route.operation), operationHelperDetail: { lroDetails: extractOperationLroDetail( @@ -191,19 +154,3 @@ function hasRequiredOptions( .some((parameter) => parameter.param.optional === false); return isRequiredBodyParam || containsRequiredNonBodyParam; } - -/** - * Extracts all success or defined status codes for a give operation - */ -export function gerOperationSuccessStatus(operation: HttpOperation): string[] { - const responses = operation.responses ?? []; - const status: string[] = []; - - for (const response of responses) { - if (isDefinedStatusCode(response.statusCode)) { - status.push(response.statusCode); - } - } - - return status; -} diff --git a/packages/typespec-ts/src/transform/transformResponses.ts b/packages/typespec-ts/src/transform/transformResponses.ts index a1e8a1d1c1..e8ab23e69f 100644 --- a/packages/typespec-ts/src/transform/transformResponses.ts +++ b/packages/typespec-ts/src/transform/transformResponses.ts @@ -32,7 +32,8 @@ import { getOperationStatuscode, isBinaryPayload, getOperationLroOverload, - getOperationName + getOperationName, + sortedOperationResponses } from "../utils/operationUtil.js"; import { SdkContext } from "../utils/interfaces.js"; @@ -78,7 +79,7 @@ export function transformToResponseTypes( path: route.path, responses: [] }; - for (const resp of route.responses) { + for (const resp of sortedOperationResponses(route.responses)) { const statusCode = getOperationStatuscode(resp); const rlcResponseUnit: ResponseMetadata = { statusCode, diff --git a/packages/typespec-ts/src/utils/clientUtils.ts b/packages/typespec-ts/src/utils/clientUtils.ts index 28d2b915df..cdd3c7cba4 100644 --- a/packages/typespec-ts/src/utils/clientUtils.ts +++ b/packages/typespec-ts/src/utils/clientUtils.ts @@ -1,17 +1,25 @@ import { SdkClient } from "@azure-tools/typespec-client-generator-core"; -import { Namespace, listServices } from "@typespec/compiler"; +import { + Namespace, + getNamespaceFullName, + listServices +} from "@typespec/compiler"; import { SdkContext } from "./interfaces.js"; export function getRLCClients(dpgContext: SdkContext): SdkClient[] { const services = listServices(dpgContext.program); return services.map((service) => { + const clientName = service.type.name + "Client"; return { kind: "SdkClient", - name: service.type.name + "Client", + name: clientName, service: service.type, type: service.type, - arm: isArm(service.type) + arm: isArm(service.type), + crossLanguageDefinitionId: `${getNamespaceFullName( + service.type + )}.${clientName}` }; }); } diff --git a/packages/typespec-ts/src/utils/operationUtil.ts b/packages/typespec-ts/src/utils/operationUtil.ts index 6f9b0c248e..3865b56627 100644 --- a/packages/typespec-ts/src/utils/operationUtil.ts +++ b/packages/typespec-ts/src/utils/operationUtil.ts @@ -7,6 +7,7 @@ import { ResponseMetadata, ResponseTypes, getLroLogicalResponseName, + getResponseTypeName, normalizeName } from "@azure-tools/rlc-common"; import { @@ -23,7 +24,7 @@ import { HttpOperation, HttpOperationParameter, HttpOperationResponse, - StatusCode, + HttpStatusCodesEntry, getHttpOperation } from "@typespec/http"; import { @@ -44,14 +45,85 @@ import { import { isByteOrByteUnion } from "./modelUtils.js"; import { SdkContext } from "./interfaces.js"; +// Sorts the responses by status code +export function sortedOperationResponses(responses: HttpOperationResponse[]) { + return responses.sort((a, b) => { + if (a.statusCodes === "*") { + return 1; + } + if (b.statusCodes === "*") { + return -1; + } + const aStatus = + typeof a.statusCodes === "number" ? a.statusCodes : a.statusCodes.start; + const bStatus = + typeof b.statusCodes === "number" ? b.statusCodes : b.statusCodes.start; + return aStatus - bStatus; + }); +} + +/** + * This function computes all the response types error and success + * an operation can end up returning. + */ +export function getOperationResponseTypes( + dpgContext: SdkContext, + operation: HttpOperation +): ResponseTypes { + const returnTypes: ResponseTypes = { + error: [], + success: [] + }; + function getResponseType(responses: HttpOperationResponse[]) { + return responses.map((r) => { + const statusCode = getOperationStatuscode(r); + const responseName = getResponseTypeName( + getOperationGroupName(dpgContext, operation), + getOperationName(dpgContext.program, operation.operation), + statusCode + ); + return responseName; + }); + } + if (operation.responses && operation.responses.length) { + returnTypes.error = getResponseType( + operation.responses.filter((r) => isDefaultStatusCode(r.statusCodes)) + ); + returnTypes.success = getResponseType( + operation.responses.filter((r) => isDefinedStatusCode(r.statusCodes)) + ); + } + return returnTypes; +} + +/** + * Extracts all success or defined status codes for a give operation + */ +export function getOperationSuccessStatus(operation: HttpOperation): string[] { + const responses = operation.responses ?? []; + const status: string[] = []; + + for (const response of responses) { + if (isDefinedStatusCode(response.statusCodes)) { + status.push(getOperationStatuscode(response)); + } + } + + return status; +} + export function getOperationStatuscode( response: HttpOperationResponse ): string { - switch (response.statusCode) { - case "*": - return "default"; - default: - return `${response.statusCode}`; + const statusCodes = response.statusCodes; + if (statusCodes === "*") { + return "default"; + } else if (typeof statusCodes === "number") { + return String(statusCodes); + } else { + // FIXME - this is a hack to get the first status code + // https://github.com/Azure/autorest.typescript/issues/2063 + return String(statusCodes.start); } } @@ -105,12 +177,12 @@ export function getOperationName(program: Program, operation: Operation) { ); } -export function isDefaultStatusCode(statusCode: StatusCode) { - return statusCode === "*"; +export function isDefaultStatusCode(statusCodes: HttpStatusCodesEntry) { + return statusCodes === "*"; } -export function isDefinedStatusCode(statusCode: StatusCode) { - return statusCode !== "*"; +export function isDefinedStatusCode(statusCodes: HttpStatusCodesEntry) { + return statusCodes !== "*"; } export function isBinaryPayload( diff --git a/packages/typespec-ts/test/commands/cadl-ranch-list.ts b/packages/typespec-ts/test/commands/cadl-ranch-list.ts index 290354e169..8ff94945a0 100644 --- a/packages/typespec-ts/test/commands/cadl-ranch-list.ts +++ b/packages/typespec-ts/test/commands/cadl-ranch-list.ts @@ -153,10 +153,6 @@ export const rlcTsps: TypeSpecRanchConfig[] = [ outputPath: "projection", inputPath: "projection/projected-name" }, - { - outputPath: "internal", - inputPath: "azure/client-generator-core/internal" - }, { outputPath: "server/path/single", inputPath: "server/path/single" diff --git a/packages/typespec-ts/test/integration/generated/internal/src/clientDefinitions.ts b/packages/typespec-ts/test/integration/generated/internal/src/clientDefinitions.ts deleted file mode 100644 index 766e87dc21..0000000000 --- a/packages/typespec-ts/test/integration/generated/internal/src/clientDefinitions.ts +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. - -import { - SharedPublicParameters, - SharedInternalParameters, - PublicOnlyParameters, - InternalOnlyParameters, -} from "./parameters"; -import { - SharedPublic200Response, - SharedInternal200Response, - PublicOnly200Response, - InternalOnly200Response, -} from "./responses"; -import { Client, StreamableMethod } from "@azure-rest/core-client"; - -export interface Public { - get( - options: SharedPublicParameters - ): StreamableMethod; -} - -export interface Internal { - get( - options: SharedInternalParameters - ): StreamableMethod; -} - -export interface PublicOnly { - get(options: PublicOnlyParameters): StreamableMethod; -} - -export interface InternalOnly { - get( - options: InternalOnlyParameters - ): StreamableMethod; -} - -export interface Routes { - /** Resource for '/azure/client-generator-core/internal/shared/public' has methods for the following verbs: get */ - (path: "/azure/client-generator-core/internal/shared/public"): Public; - /** Resource for '/azure/client-generator-core/internal/shared/internal' has methods for the following verbs: get */ - (path: "/azure/client-generator-core/internal/shared/internal"): Internal; - /** Resource for '/azure/client-generator-core/internal/public' has methods for the following verbs: get */ - (path: "/azure/client-generator-core/internal/public"): PublicOnly; - /** Resource for '/azure/client-generator-core/internal/internal' has methods for the following verbs: get */ - (path: "/azure/client-generator-core/internal/internal"): InternalOnly; -} - -export type InternalClient = Client & { - path: Routes; -}; diff --git a/packages/typespec-ts/test/integration/generated/internal/src/index.ts b/packages/typespec-ts/test/integration/generated/internal/src/index.ts deleted file mode 100644 index 1ca207d280..0000000000 --- a/packages/typespec-ts/test/integration/generated/internal/src/index.ts +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. - -import InternalClient from "./internalClient"; - -export * from "./internalClient"; -export * from "./parameters"; -export * from "./responses"; -export * from "./clientDefinitions"; -export * from "./outputModels"; - -export default InternalClient; diff --git a/packages/typespec-ts/test/integration/generated/internal/src/internalClient.ts b/packages/typespec-ts/test/integration/generated/internal/src/internalClient.ts deleted file mode 100644 index cef89ec8ef..0000000000 --- a/packages/typespec-ts/test/integration/generated/internal/src/internalClient.ts +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. - -import { getClient, ClientOptions } from "@azure-rest/core-client"; -import { logger } from "./logger"; -import { InternalClient } from "./clientDefinitions"; - -/** - * Initialize a new instance of `InternalClient` - * @param options - the parameter for all optional parameters - */ -export default function createClient( - options: ClientOptions = {} -): InternalClient { - const baseUrl = options.baseUrl ?? `http://localhost:3000`; - options.apiVersion = options.apiVersion ?? "1.0.0"; - const userAgentInfo = `azsdk-js-internal-rest/1.0.0-beta.1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}` - : `${userAgentInfo}`; - options = { - ...options, - userAgentOptions: { - userAgentPrefix, - }, - loggingOptions: { - logger: options.loggingOptions?.logger ?? logger.info, - }, - }; - - const client = getClient(baseUrl, options) as InternalClient; - - return client; -} diff --git a/packages/typespec-ts/test/integration/generated/internal/src/logger.ts b/packages/typespec-ts/test/integration/generated/internal/src/logger.ts deleted file mode 100644 index 0612697b44..0000000000 --- a/packages/typespec-ts/test/integration/generated/internal/src/logger.ts +++ /dev/null @@ -1,5 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. - -import { createClientLogger } from "@azure/logger"; -export const logger = createClientLogger("internal"); diff --git a/packages/typespec-ts/test/integration/generated/internal/src/outputModels.ts b/packages/typespec-ts/test/integration/generated/internal/src/outputModels.ts deleted file mode 100644 index 2732355414..0000000000 --- a/packages/typespec-ts/test/integration/generated/internal/src/outputModels.ts +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. - -/** This is a model used by both public and internal operation. It should be generated and exported. */ -export interface SharedModelOutput { - name: string; -} - -/** This is a model only used by public operation. It should be generated and exported. */ -export interface PublicModelOutput { - name: string; -} - -/** This is a model only used by internal operation. It should be generated but not exported. */ -export interface InternalModelOutput { - name: string; -} diff --git a/packages/typespec-ts/test/integration/generated/internal/src/parameters.ts b/packages/typespec-ts/test/integration/generated/internal/src/parameters.ts deleted file mode 100644 index 78413fd615..0000000000 --- a/packages/typespec-ts/test/integration/generated/internal/src/parameters.ts +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. - -import { RequestParameters } from "@azure-rest/core-client"; - -export interface SharedPublicQueryParamProperties { - name: string; -} - -export interface SharedPublicQueryParam { - queryParameters: SharedPublicQueryParamProperties; -} - -export type SharedPublicParameters = SharedPublicQueryParam & RequestParameters; - -export interface SharedInternalQueryParamProperties { - name: string; -} - -export interface SharedInternalQueryParam { - queryParameters: SharedInternalQueryParamProperties; -} - -export type SharedInternalParameters = SharedInternalQueryParam & - RequestParameters; - -export interface PublicOnlyQueryParamProperties { - name: string; -} - -export interface PublicOnlyQueryParam { - queryParameters: PublicOnlyQueryParamProperties; -} - -export type PublicOnlyParameters = PublicOnlyQueryParam & RequestParameters; - -export interface InternalOnlyQueryParamProperties { - name: string; -} - -export interface InternalOnlyQueryParam { - queryParameters: InternalOnlyQueryParamProperties; -} - -export type InternalOnlyParameters = InternalOnlyQueryParam & RequestParameters; diff --git a/packages/typespec-ts/test/integration/generated/internal/src/responses.ts b/packages/typespec-ts/test/integration/generated/internal/src/responses.ts deleted file mode 100644 index 73716524ae..0000000000 --- a/packages/typespec-ts/test/integration/generated/internal/src/responses.ts +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. - -import { HttpResponse } from "@azure-rest/core-client"; -import { - SharedModelOutput, - PublicModelOutput, - InternalModelOutput, -} from "./outputModels"; - -/** The request has succeeded. */ -export interface SharedPublic200Response extends HttpResponse { - status: "200"; - body: SharedModelOutput; -} - -/** The request has succeeded. */ -export interface SharedInternal200Response extends HttpResponse { - status: "200"; - body: SharedModelOutput; -} - -/** The request has succeeded. */ -export interface PublicOnly200Response extends HttpResponse { - status: "200"; - body: PublicModelOutput; -} - -/** The request has succeeded. */ -export interface InternalOnly200Response extends HttpResponse { - status: "200"; - body: InternalModelOutput; -} diff --git a/packages/typespec-ts/test/integration/generated/internal/tspconfig.yaml b/packages/typespec-ts/test/integration/generated/internal/tspconfig.yaml deleted file mode 100644 index 5db26b6377..0000000000 --- a/packages/typespec-ts/test/integration/generated/internal/tspconfig.yaml +++ /dev/null @@ -1,15 +0,0 @@ -emit: - - "@azure-tools/typespec-ts" -options: - "@azure-tools/typespec-ts": - "emitter-output-dir": "{project-root}" - generateMetadata: false - generateTest: false - addCredentials: false - azureSdkForJs: false - isTypeSpecTest: true - enableOperationGroup: true - title: InternalClient - packageDetails: - name: "@msinternal/internal" - description: "Internal Test Service" diff --git a/packages/typespec-ts/test/integration/generated/specialWords/src/clientDefinitions.ts b/packages/typespec-ts/test/integration/generated/specialWords/src/clientDefinitions.ts index 2d4ab14a9a..2d720062fe 100644 --- a/packages/typespec-ts/test/integration/generated/specialWords/src/clientDefinitions.ts +++ b/packages/typespec-ts/test/integration/generated/specialWords/src/clientDefinitions.ts @@ -2,58 +2,1026 @@ // Licensed under the MIT license. import { - OperationForParameters, - ParameterGetWithIfParameters, - ParameterGetWithFilterParameters, - ModelGetParameters, - ModelPutParameters, + ModelsWithAndParameters, + ModelsWithAsParameters, + ModelsWithAssertParameters, + ModelsWithAsyncParameters, + ModelsWithAwaitParameters, + ModelsWithBreakParameters, + ModelsWithClassParameters, + ModelsWithConstructorParameters, + ModelsWithContinueParameters, + ModelsWithDefParameters, + ModelsWithDelParameters, + ModelsWithElifParameters, + ModelsWithElseParameters, + ModelsWithExceptParameters, + ModelsWithExecParameters, + ModelsWithFinallyParameters, + ModelsWithForParameters, + ModelsWithFromParameters, + ModelsWithGlobalParameters, + ModelsWithIfParameters, + ModelsWithImportParameters, + ModelsWithInParameters, + ModelsWithIsParameters, + ModelsWithLambdaParameters, + ModelsWithNotParameters, + ModelsWithOrParameters, + ModelsWithPassParameters, + ModelsWithRaiseParameters, + ModelsWithReturnParameters, + ModelsWithTryParameters, + ModelsWithWhileParameters, + ModelsWithWithParameters, + ModelsWithYieldParameters, + ModelPropertiesSameAsModelParameters, + OperationsAndParameters, + OperationsAsParameters, + OperationsAssertParameters, + OperationsAsyncParameters, + OperationsAwaitParameters, + OperationsBreakParameters, + OperationsClassParameters, + OperationsConstructorParameters, + OperationsContinueParameters, + OperationsDefParameters, + OperationsDelParameters, + OperationsElifParameters, + OperationsElseParameters, + OperationsExceptParameters, + OperationsExecParameters, + OperationsFinallyParameters, + OperationsForParameters, + OperationsFromParameters, + OperationsGlobalParameters, + OperationsIfParameters, + OperationsImportParameters, + OperationsInParameters, + OperationsIsParameters, + OperationsLambdaParameters, + OperationsNotParameters, + OperationsOrParameters, + OperationsPassParameters, + OperationsRaiseParameters, + OperationsReturnParameters, + OperationsTryParameters, + OperationsWhileParameters, + OperationsWithParameters, + OperationsYieldParameters, + ParametersWithAndParameters, + ParametersWithAsParameters, + ParametersWithAssertParameters, + ParametersWithAsyncParameters, + ParametersWithAwaitParameters, + ParametersWithBreakParameters, + ParametersWithClassParameters, + ParametersWithConstructorParameters, + ParametersWithContinueParameters, + ParametersWithDefParameters, + ParametersWithDelParameters, + ParametersWithElifParameters, + ParametersWithElseParameters, + ParametersWithExceptParameters, + ParametersWithExecParameters, + ParametersWithFinallyParameters, + ParametersWithForParameters, + ParametersWithFromParameters, + ParametersWithGlobalParameters, + ParametersWithIfParameters, + ParametersWithImportParameters, + ParametersWithInParameters, + ParametersWithIsParameters, + ParametersWithLambdaParameters, + ParametersWithNotParameters, + ParametersWithOrParameters, + ParametersWithPassParameters, + ParametersWithRaiseParameters, + ParametersWithReturnParameters, + ParametersWithTryParameters, + ParametersWithWhileParameters, + ParametersWithWithParameters, + ParametersWithYieldParameters, + ParametersWithCancellationTokenParameters, } from "./parameters"; import { - OperationFor204Response, - ParameterGetWithIf204Response, - ParameterGetWithFilter204Response, - ModelGet200Response, - ModelPut204Response, + ModelsWithAnd204Response, + ModelsWithAs204Response, + ModelsWithAssert204Response, + ModelsWithAsync204Response, + ModelsWithAwait204Response, + ModelsWithBreak204Response, + ModelsWithClass204Response, + ModelsWithConstructor204Response, + ModelsWithContinue204Response, + ModelsWithDef204Response, + ModelsWithDel204Response, + ModelsWithElif204Response, + ModelsWithElse204Response, + ModelsWithExcept204Response, + ModelsWithExec204Response, + ModelsWithFinally204Response, + ModelsWithFor204Response, + ModelsWithFrom204Response, + ModelsWithGlobal204Response, + ModelsWithIf204Response, + ModelsWithImport204Response, + ModelsWithIn204Response, + ModelsWithIs204Response, + ModelsWithLambda204Response, + ModelsWithNot204Response, + ModelsWithOr204Response, + ModelsWithPass204Response, + ModelsWithRaise204Response, + ModelsWithReturn204Response, + ModelsWithTry204Response, + ModelsWithWhile204Response, + ModelsWithWith204Response, + ModelsWithYield204Response, + ModelPropertiesSameAsModel204Response, + OperationsAnd204Response, + OperationsAs204Response, + OperationsAssert204Response, + OperationsAsync204Response, + OperationsAwait204Response, + OperationsBreak204Response, + OperationsClass204Response, + OperationsConstructor204Response, + OperationsContinue204Response, + OperationsDef204Response, + OperationsDel204Response, + OperationsElif204Response, + OperationsElse204Response, + OperationsExcept204Response, + OperationsExec204Response, + OperationsFinally204Response, + OperationsFor204Response, + OperationsFrom204Response, + OperationsGlobal204Response, + OperationsIf204Response, + OperationsImport204Response, + OperationsIn204Response, + OperationsIs204Response, + OperationsLambda204Response, + OperationsNot204Response, + OperationsOr204Response, + OperationsPass204Response, + OperationsRaise204Response, + OperationsReturn204Response, + OperationsTry204Response, + OperationsWhile204Response, + OperationsWith204Response, + OperationsYield204Response, + ParametersWithAnd204Response, + ParametersWithAs204Response, + ParametersWithAssert204Response, + ParametersWithAsync204Response, + ParametersWithAwait204Response, + ParametersWithBreak204Response, + ParametersWithClass204Response, + ParametersWithConstructor204Response, + ParametersWithContinue204Response, + ParametersWithDef204Response, + ParametersWithDel204Response, + ParametersWithElif204Response, + ParametersWithElse204Response, + ParametersWithExcept204Response, + ParametersWithExec204Response, + ParametersWithFinally204Response, + ParametersWithFor204Response, + ParametersWithFrom204Response, + ParametersWithGlobal204Response, + ParametersWithIf204Response, + ParametersWithImport204Response, + ParametersWithIn204Response, + ParametersWithIs204Response, + ParametersWithLambda204Response, + ParametersWithNot204Response, + ParametersWithOr204Response, + ParametersWithPass204Response, + ParametersWithRaise204Response, + ParametersWithReturn204Response, + ParametersWithTry204Response, + ParametersWithWhile204Response, + ParametersWithWith204Response, + ParametersWithYield204Response, + ParametersWithCancellationToken204Response, } from "./responses"; import { Client, StreamableMethod } from "@azure-rest/core-client"; -export interface OperationFor { +export interface ModelsWithAnd { + post( + options: ModelsWithAndParameters + ): StreamableMethod; +} + +export interface ModelsWithAs { + post( + options: ModelsWithAsParameters + ): StreamableMethod; +} + +export interface ModelsWithAssert { + post( + options: ModelsWithAssertParameters + ): StreamableMethod; +} + +export interface ModelsWithAsync { + post( + options: ModelsWithAsyncParameters + ): StreamableMethod; +} + +export interface ModelsWithAwait { + post( + options: ModelsWithAwaitParameters + ): StreamableMethod; +} + +export interface ModelsWithBreak { + post( + options: ModelsWithBreakParameters + ): StreamableMethod; +} + +export interface ModelsWithClass { + post( + options: ModelsWithClassParameters + ): StreamableMethod; +} + +export interface ModelsWithConstructor { + post( + options: ModelsWithConstructorParameters + ): StreamableMethod; +} + +export interface ModelsWithContinue { + post( + options: ModelsWithContinueParameters + ): StreamableMethod; +} + +export interface ModelsWithDef { + post( + options: ModelsWithDefParameters + ): StreamableMethod; +} + +export interface ModelsWithDel { + post( + options: ModelsWithDelParameters + ): StreamableMethod; +} + +export interface ModelsWithElif { + post( + options: ModelsWithElifParameters + ): StreamableMethod; +} + +export interface ModelsWithElse { + post( + options: ModelsWithElseParameters + ): StreamableMethod; +} + +export interface ModelsWithExcept { + post( + options: ModelsWithExceptParameters + ): StreamableMethod; +} + +export interface ModelsWithExec { + post( + options: ModelsWithExecParameters + ): StreamableMethod; +} + +export interface ModelsWithFinally { + post( + options: ModelsWithFinallyParameters + ): StreamableMethod; +} + +export interface ModelsWithFor { + post( + options: ModelsWithForParameters + ): StreamableMethod; +} + +export interface ModelsWithFrom { + post( + options: ModelsWithFromParameters + ): StreamableMethod; +} + +export interface ModelsWithGlobal { + post( + options: ModelsWithGlobalParameters + ): StreamableMethod; +} + +export interface ModelsWithIf { + post( + options: ModelsWithIfParameters + ): StreamableMethod; +} + +export interface ModelsWithImport { + post( + options: ModelsWithImportParameters + ): StreamableMethod; +} + +export interface ModelsWithIn { + post( + options: ModelsWithInParameters + ): StreamableMethod; +} + +export interface ModelsWithIs { + post( + options: ModelsWithIsParameters + ): StreamableMethod; +} + +export interface ModelsWithLambda { + post( + options: ModelsWithLambdaParameters + ): StreamableMethod; +} + +export interface ModelsWithNot { + post( + options: ModelsWithNotParameters + ): StreamableMethod; +} + +export interface ModelsWithOr { + post( + options: ModelsWithOrParameters + ): StreamableMethod; +} + +export interface ModelsWithPass { + post( + options: ModelsWithPassParameters + ): StreamableMethod; +} + +export interface ModelsWithRaise { + post( + options: ModelsWithRaiseParameters + ): StreamableMethod; +} + +export interface ModelsWithReturn { + post( + options: ModelsWithReturnParameters + ): StreamableMethod; +} + +export interface ModelsWithTry { + post( + options: ModelsWithTryParameters + ): StreamableMethod; +} + +export interface ModelsWithWhile { + post( + options: ModelsWithWhileParameters + ): StreamableMethod; +} + +export interface ModelsWithWith { + post( + options: ModelsWithWithParameters + ): StreamableMethod; +} + +export interface ModelsWithYield { + post( + options: ModelsWithYieldParameters + ): StreamableMethod; +} + +export interface ModelPropertiesSameAsModel { + post( + options: ModelPropertiesSameAsModelParameters + ): StreamableMethod; +} + +export interface OperationsAnd { + get( + options?: OperationsAndParameters + ): StreamableMethod; +} + +export interface OperationsAs { + get( + options?: OperationsAsParameters + ): StreamableMethod; +} + +export interface OperationsAssert { + get( + options?: OperationsAssertParameters + ): StreamableMethod; +} + +export interface OperationsAsync { + get( + options?: OperationsAsyncParameters + ): StreamableMethod; +} + +export interface OperationsAwait { + get( + options?: OperationsAwaitParameters + ): StreamableMethod; +} + +export interface OperationsBreak { + get( + options?: OperationsBreakParameters + ): StreamableMethod; +} + +export interface OperationsClass { + get( + options?: OperationsClassParameters + ): StreamableMethod; +} + +export interface OperationsConstructor { + get( + options?: OperationsConstructorParameters + ): StreamableMethod; +} + +export interface OperationsContinue { + get( + options?: OperationsContinueParameters + ): StreamableMethod; +} + +export interface OperationsDef { + get( + options?: OperationsDefParameters + ): StreamableMethod; +} + +export interface OperationsDel { + get( + options?: OperationsDelParameters + ): StreamableMethod; +} + +export interface OperationsElif { + get( + options?: OperationsElifParameters + ): StreamableMethod; +} + +export interface OperationsElse { + get( + options?: OperationsElseParameters + ): StreamableMethod; +} + +export interface OperationsExcept { + get( + options?: OperationsExceptParameters + ): StreamableMethod; +} + +export interface OperationsExec { + get( + options?: OperationsExecParameters + ): StreamableMethod; +} + +export interface OperationsFinally { + get( + options?: OperationsFinallyParameters + ): StreamableMethod; +} + +export interface OperationsFor { + get( + options?: OperationsForParameters + ): StreamableMethod; +} + +export interface OperationsFrom { + get( + options?: OperationsFromParameters + ): StreamableMethod; +} + +export interface OperationsGlobal { + get( + options?: OperationsGlobalParameters + ): StreamableMethod; +} + +export interface OperationsIf { + get( + options?: OperationsIfParameters + ): StreamableMethod; +} + +export interface OperationsImport { get( - options?: OperationForParameters - ): StreamableMethod; + options?: OperationsImportParameters + ): StreamableMethod; } -export interface ParameterGetWithIf { +export interface OperationsIn { get( - options: ParameterGetWithIfParameters - ): StreamableMethod; + options?: OperationsInParameters + ): StreamableMethod; } -export interface ParameterGetWithFilter { +export interface OperationsIs { get( - options: ParameterGetWithFilterParameters - ): StreamableMethod; + options?: OperationsIsParameters + ): StreamableMethod; } -export interface ModelGet { - get(options?: ModelGetParameters): StreamableMethod; +export interface OperationsLambda { + get( + options?: OperationsLambdaParameters + ): StreamableMethod; +} + +export interface OperationsNot { + get( + options?: OperationsNotParameters + ): StreamableMethod; +} + +export interface OperationsOr { + get( + options?: OperationsOrParameters + ): StreamableMethod; +} + +export interface OperationsPass { + get( + options?: OperationsPassParameters + ): StreamableMethod; +} + +export interface OperationsRaise { + get( + options?: OperationsRaiseParameters + ): StreamableMethod; +} + +export interface OperationsReturn { + get( + options?: OperationsReturnParameters + ): StreamableMethod; +} + +export interface OperationsTry { + get( + options?: OperationsTryParameters + ): StreamableMethod; +} + +export interface OperationsWhile { + get( + options?: OperationsWhileParameters + ): StreamableMethod; +} + +export interface OperationsWith { + get( + options?: OperationsWithParameters + ): StreamableMethod; +} + +export interface OperationsYield { + get( + options?: OperationsYieldParameters + ): StreamableMethod; +} + +export interface ParametersWithAnd { + get( + options: ParametersWithAndParameters + ): StreamableMethod; +} + +export interface ParametersWithAs { + get( + options: ParametersWithAsParameters + ): StreamableMethod; +} + +export interface ParametersWithAssert { + get( + options: ParametersWithAssertParameters + ): StreamableMethod; +} + +export interface ParametersWithAsync { + get( + options: ParametersWithAsyncParameters + ): StreamableMethod; +} + +export interface ParametersWithAwait { + get( + options: ParametersWithAwaitParameters + ): StreamableMethod; +} + +export interface ParametersWithBreak { + get( + options: ParametersWithBreakParameters + ): StreamableMethod; +} + +export interface ParametersWithClass { + get( + options: ParametersWithClassParameters + ): StreamableMethod; +} + +export interface ParametersWithConstructor { + get( + options: ParametersWithConstructorParameters + ): StreamableMethod; +} + +export interface ParametersWithContinue { + get( + options: ParametersWithContinueParameters + ): StreamableMethod; +} + +export interface ParametersWithDef { + get( + options: ParametersWithDefParameters + ): StreamableMethod; +} + +export interface ParametersWithDel { + get( + options: ParametersWithDelParameters + ): StreamableMethod; +} + +export interface ParametersWithElif { + get( + options: ParametersWithElifParameters + ): StreamableMethod; } -export interface ModelPut { - put(options: ModelPutParameters): StreamableMethod; +export interface ParametersWithElse { + get( + options: ParametersWithElseParameters + ): StreamableMethod; +} + +export interface ParametersWithExcept { + get( + options: ParametersWithExceptParameters + ): StreamableMethod; +} + +export interface ParametersWithExec { + get( + options: ParametersWithExecParameters + ): StreamableMethod; +} + +export interface ParametersWithFinally { + get( + options: ParametersWithFinallyParameters + ): StreamableMethod; +} + +export interface ParametersWithFor { + get( + options: ParametersWithForParameters + ): StreamableMethod; +} + +export interface ParametersWithFrom { + get( + options: ParametersWithFromParameters + ): StreamableMethod; +} + +export interface ParametersWithGlobal { + get( + options: ParametersWithGlobalParameters + ): StreamableMethod; +} + +export interface ParametersWithIf { + get( + options: ParametersWithIfParameters + ): StreamableMethod; +} + +export interface ParametersWithImport { + get( + options: ParametersWithImportParameters + ): StreamableMethod; +} + +export interface ParametersWithIn { + get( + options: ParametersWithInParameters + ): StreamableMethod; +} + +export interface ParametersWithIs { + get( + options: ParametersWithIsParameters + ): StreamableMethod; +} + +export interface ParametersWithLambda { + get( + options: ParametersWithLambdaParameters + ): StreamableMethod; +} + +export interface ParametersWithNot { + get( + options: ParametersWithNotParameters + ): StreamableMethod; +} + +export interface ParametersWithOr { + get( + options: ParametersWithOrParameters + ): StreamableMethod; +} + +export interface ParametersWithPass { + get( + options: ParametersWithPassParameters + ): StreamableMethod; +} + +export interface ParametersWithRaise { + get( + options: ParametersWithRaiseParameters + ): StreamableMethod; +} + +export interface ParametersWithReturn { + get( + options: ParametersWithReturnParameters + ): StreamableMethod; +} + +export interface ParametersWithTry { + get( + options: ParametersWithTryParameters + ): StreamableMethod; +} + +export interface ParametersWithWhile { + get( + options: ParametersWithWhileParameters + ): StreamableMethod; +} + +export interface ParametersWithWith { + get( + options: ParametersWithWithParameters + ): StreamableMethod; +} + +export interface ParametersWithYield { + get( + options: ParametersWithYieldParameters + ): StreamableMethod; +} + +export interface ParametersWithCancellationToken { + get( + options: ParametersWithCancellationTokenParameters + ): StreamableMethod; } export interface Routes { - /** Resource for '/special-words/operation/for' has methods for the following verbs: get */ - (path: "/special-words/operation/for"): OperationFor; - /** Resource for '/special-words/parameter/if' has methods for the following verbs: get */ - (path: "/special-words/parameter/if"): ParameterGetWithIf; - /** Resource for '/special-words/parameter/filter' has methods for the following verbs: get */ - (path: "/special-words/parameter/filter"): ParameterGetWithFilter; - /** Resource for '/special-words/model/get' has methods for the following verbs: get */ - (path: "/special-words/model/get"): ModelGet; - /** Resource for '/special-words/model/put' has methods for the following verbs: put */ - (path: "/special-words/model/put"): ModelPut; + /** Resource for '/special-words/models/and' has methods for the following verbs: post */ + (path: "/special-words/models/and"): ModelsWithAnd; + /** Resource for '/special-words/models/as' has methods for the following verbs: post */ + (path: "/special-words/models/as"): ModelsWithAs; + /** Resource for '/special-words/models/assert' has methods for the following verbs: post */ + (path: "/special-words/models/assert"): ModelsWithAssert; + /** Resource for '/special-words/models/async' has methods for the following verbs: post */ + (path: "/special-words/models/async"): ModelsWithAsync; + /** Resource for '/special-words/models/await' has methods for the following verbs: post */ + (path: "/special-words/models/await"): ModelsWithAwait; + /** Resource for '/special-words/models/break' has methods for the following verbs: post */ + (path: "/special-words/models/break"): ModelsWithBreak; + /** Resource for '/special-words/models/class' has methods for the following verbs: post */ + (path: "/special-words/models/class"): ModelsWithClass; + /** Resource for '/special-words/models/constructor' has methods for the following verbs: post */ + (path: "/special-words/models/constructor"): ModelsWithConstructor; + /** Resource for '/special-words/models/continue' has methods for the following verbs: post */ + (path: "/special-words/models/continue"): ModelsWithContinue; + /** Resource for '/special-words/models/def' has methods for the following verbs: post */ + (path: "/special-words/models/def"): ModelsWithDef; + /** Resource for '/special-words/models/del' has methods for the following verbs: post */ + (path: "/special-words/models/del"): ModelsWithDel; + /** Resource for '/special-words/models/elif' has methods for the following verbs: post */ + (path: "/special-words/models/elif"): ModelsWithElif; + /** Resource for '/special-words/models/else' has methods for the following verbs: post */ + (path: "/special-words/models/else"): ModelsWithElse; + /** Resource for '/special-words/models/except' has methods for the following verbs: post */ + (path: "/special-words/models/except"): ModelsWithExcept; + /** Resource for '/special-words/models/exec' has methods for the following verbs: post */ + (path: "/special-words/models/exec"): ModelsWithExec; + /** Resource for '/special-words/models/finally' has methods for the following verbs: post */ + (path: "/special-words/models/finally"): ModelsWithFinally; + /** Resource for '/special-words/models/for' has methods for the following verbs: post */ + (path: "/special-words/models/for"): ModelsWithFor; + /** Resource for '/special-words/models/from' has methods for the following verbs: post */ + (path: "/special-words/models/from"): ModelsWithFrom; + /** Resource for '/special-words/models/global' has methods for the following verbs: post */ + (path: "/special-words/models/global"): ModelsWithGlobal; + /** Resource for '/special-words/models/if' has methods for the following verbs: post */ + (path: "/special-words/models/if"): ModelsWithIf; + /** Resource for '/special-words/models/import' has methods for the following verbs: post */ + (path: "/special-words/models/import"): ModelsWithImport; + /** Resource for '/special-words/models/in' has methods for the following verbs: post */ + (path: "/special-words/models/in"): ModelsWithIn; + /** Resource for '/special-words/models/is' has methods for the following verbs: post */ + (path: "/special-words/models/is"): ModelsWithIs; + /** Resource for '/special-words/models/lambda' has methods for the following verbs: post */ + (path: "/special-words/models/lambda"): ModelsWithLambda; + /** Resource for '/special-words/models/not' has methods for the following verbs: post */ + (path: "/special-words/models/not"): ModelsWithNot; + /** Resource for '/special-words/models/or' has methods for the following verbs: post */ + (path: "/special-words/models/or"): ModelsWithOr; + /** Resource for '/special-words/models/pass' has methods for the following verbs: post */ + (path: "/special-words/models/pass"): ModelsWithPass; + /** Resource for '/special-words/models/raise' has methods for the following verbs: post */ + (path: "/special-words/models/raise"): ModelsWithRaise; + /** Resource for '/special-words/models/return' has methods for the following verbs: post */ + (path: "/special-words/models/return"): ModelsWithReturn; + /** Resource for '/special-words/models/try' has methods for the following verbs: post */ + (path: "/special-words/models/try"): ModelsWithTry; + /** Resource for '/special-words/models/while' has methods for the following verbs: post */ + (path: "/special-words/models/while"): ModelsWithWhile; + /** Resource for '/special-words/models/with' has methods for the following verbs: post */ + (path: "/special-words/models/with"): ModelsWithWith; + /** Resource for '/special-words/models/yield' has methods for the following verbs: post */ + (path: "/special-words/models/yield"): ModelsWithYield; + /** Resource for '/special-words/model-properties/same-as-model' has methods for the following verbs: post */ + ( + path: "/special-words/model-properties/same-as-model" + ): ModelPropertiesSameAsModel; + /** Resource for '/special-words/operations/and' has methods for the following verbs: get */ + (path: "/special-words/operations/and"): OperationsAnd; + /** Resource for '/special-words/operations/as' has methods for the following verbs: get */ + (path: "/special-words/operations/as"): OperationsAs; + /** Resource for '/special-words/operations/assert' has methods for the following verbs: get */ + (path: "/special-words/operations/assert"): OperationsAssert; + /** Resource for '/special-words/operations/async' has methods for the following verbs: get */ + (path: "/special-words/operations/async"): OperationsAsync; + /** Resource for '/special-words/operations/await' has methods for the following verbs: get */ + (path: "/special-words/operations/await"): OperationsAwait; + /** Resource for '/special-words/operations/break' has methods for the following verbs: get */ + (path: "/special-words/operations/break"): OperationsBreak; + /** Resource for '/special-words/operations/class' has methods for the following verbs: get */ + (path: "/special-words/operations/class"): OperationsClass; + /** Resource for '/special-words/operations/constructor' has methods for the following verbs: get */ + (path: "/special-words/operations/constructor"): OperationsConstructor; + /** Resource for '/special-words/operations/continue' has methods for the following verbs: get */ + (path: "/special-words/operations/continue"): OperationsContinue; + /** Resource for '/special-words/operations/def' has methods for the following verbs: get */ + (path: "/special-words/operations/def"): OperationsDef; + /** Resource for '/special-words/operations/del' has methods for the following verbs: get */ + (path: "/special-words/operations/del"): OperationsDel; + /** Resource for '/special-words/operations/elif' has methods for the following verbs: get */ + (path: "/special-words/operations/elif"): OperationsElif; + /** Resource for '/special-words/operations/else' has methods for the following verbs: get */ + (path: "/special-words/operations/else"): OperationsElse; + /** Resource for '/special-words/operations/except' has methods for the following verbs: get */ + (path: "/special-words/operations/except"): OperationsExcept; + /** Resource for '/special-words/operations/exec' has methods for the following verbs: get */ + (path: "/special-words/operations/exec"): OperationsExec; + /** Resource for '/special-words/operations/finally' has methods for the following verbs: get */ + (path: "/special-words/operations/finally"): OperationsFinally; + /** Resource for '/special-words/operations/for' has methods for the following verbs: get */ + (path: "/special-words/operations/for"): OperationsFor; + /** Resource for '/special-words/operations/from' has methods for the following verbs: get */ + (path: "/special-words/operations/from"): OperationsFrom; + /** Resource for '/special-words/operations/global' has methods for the following verbs: get */ + (path: "/special-words/operations/global"): OperationsGlobal; + /** Resource for '/special-words/operations/if' has methods for the following verbs: get */ + (path: "/special-words/operations/if"): OperationsIf; + /** Resource for '/special-words/operations/import' has methods for the following verbs: get */ + (path: "/special-words/operations/import"): OperationsImport; + /** Resource for '/special-words/operations/in' has methods for the following verbs: get */ + (path: "/special-words/operations/in"): OperationsIn; + /** Resource for '/special-words/operations/is' has methods for the following verbs: get */ + (path: "/special-words/operations/is"): OperationsIs; + /** Resource for '/special-words/operations/lambda' has methods for the following verbs: get */ + (path: "/special-words/operations/lambda"): OperationsLambda; + /** Resource for '/special-words/operations/not' has methods for the following verbs: get */ + (path: "/special-words/operations/not"): OperationsNot; + /** Resource for '/special-words/operations/or' has methods for the following verbs: get */ + (path: "/special-words/operations/or"): OperationsOr; + /** Resource for '/special-words/operations/pass' has methods for the following verbs: get */ + (path: "/special-words/operations/pass"): OperationsPass; + /** Resource for '/special-words/operations/raise' has methods for the following verbs: get */ + (path: "/special-words/operations/raise"): OperationsRaise; + /** Resource for '/special-words/operations/return' has methods for the following verbs: get */ + (path: "/special-words/operations/return"): OperationsReturn; + /** Resource for '/special-words/operations/try' has methods for the following verbs: get */ + (path: "/special-words/operations/try"): OperationsTry; + /** Resource for '/special-words/operations/while' has methods for the following verbs: get */ + (path: "/special-words/operations/while"): OperationsWhile; + /** Resource for '/special-words/operations/with' has methods for the following verbs: get */ + (path: "/special-words/operations/with"): OperationsWith; + /** Resource for '/special-words/operations/yield' has methods for the following verbs: get */ + (path: "/special-words/operations/yield"): OperationsYield; + /** Resource for '/special-words/parameters/and' has methods for the following verbs: get */ + (path: "/special-words/parameters/and"): ParametersWithAnd; + /** Resource for '/special-words/parameters/as' has methods for the following verbs: get */ + (path: "/special-words/parameters/as"): ParametersWithAs; + /** Resource for '/special-words/parameters/assert' has methods for the following verbs: get */ + (path: "/special-words/parameters/assert"): ParametersWithAssert; + /** Resource for '/special-words/parameters/async' has methods for the following verbs: get */ + (path: "/special-words/parameters/async"): ParametersWithAsync; + /** Resource for '/special-words/parameters/await' has methods for the following verbs: get */ + (path: "/special-words/parameters/await"): ParametersWithAwait; + /** Resource for '/special-words/parameters/break' has methods for the following verbs: get */ + (path: "/special-words/parameters/break"): ParametersWithBreak; + /** Resource for '/special-words/parameters/class' has methods for the following verbs: get */ + (path: "/special-words/parameters/class"): ParametersWithClass; + /** Resource for '/special-words/parameters/constructor' has methods for the following verbs: get */ + (path: "/special-words/parameters/constructor"): ParametersWithConstructor; + /** Resource for '/special-words/parameters/continue' has methods for the following verbs: get */ + (path: "/special-words/parameters/continue"): ParametersWithContinue; + /** Resource for '/special-words/parameters/def' has methods for the following verbs: get */ + (path: "/special-words/parameters/def"): ParametersWithDef; + /** Resource for '/special-words/parameters/del' has methods for the following verbs: get */ + (path: "/special-words/parameters/del"): ParametersWithDel; + /** Resource for '/special-words/parameters/elif' has methods for the following verbs: get */ + (path: "/special-words/parameters/elif"): ParametersWithElif; + /** Resource for '/special-words/parameters/else' has methods for the following verbs: get */ + (path: "/special-words/parameters/else"): ParametersWithElse; + /** Resource for '/special-words/parameters/except' has methods for the following verbs: get */ + (path: "/special-words/parameters/except"): ParametersWithExcept; + /** Resource for '/special-words/parameters/exec' has methods for the following verbs: get */ + (path: "/special-words/parameters/exec"): ParametersWithExec; + /** Resource for '/special-words/parameters/finally' has methods for the following verbs: get */ + (path: "/special-words/parameters/finally"): ParametersWithFinally; + /** Resource for '/special-words/parameters/for' has methods for the following verbs: get */ + (path: "/special-words/parameters/for"): ParametersWithFor; + /** Resource for '/special-words/parameters/from' has methods for the following verbs: get */ + (path: "/special-words/parameters/from"): ParametersWithFrom; + /** Resource for '/special-words/parameters/global' has methods for the following verbs: get */ + (path: "/special-words/parameters/global"): ParametersWithGlobal; + /** Resource for '/special-words/parameters/if' has methods for the following verbs: get */ + (path: "/special-words/parameters/if"): ParametersWithIf; + /** Resource for '/special-words/parameters/import' has methods for the following verbs: get */ + (path: "/special-words/parameters/import"): ParametersWithImport; + /** Resource for '/special-words/parameters/in' has methods for the following verbs: get */ + (path: "/special-words/parameters/in"): ParametersWithIn; + /** Resource for '/special-words/parameters/is' has methods for the following verbs: get */ + (path: "/special-words/parameters/is"): ParametersWithIs; + /** Resource for '/special-words/parameters/lambda' has methods for the following verbs: get */ + (path: "/special-words/parameters/lambda"): ParametersWithLambda; + /** Resource for '/special-words/parameters/not' has methods for the following verbs: get */ + (path: "/special-words/parameters/not"): ParametersWithNot; + /** Resource for '/special-words/parameters/or' has methods for the following verbs: get */ + (path: "/special-words/parameters/or"): ParametersWithOr; + /** Resource for '/special-words/parameters/pass' has methods for the following verbs: get */ + (path: "/special-words/parameters/pass"): ParametersWithPass; + /** Resource for '/special-words/parameters/raise' has methods for the following verbs: get */ + (path: "/special-words/parameters/raise"): ParametersWithRaise; + /** Resource for '/special-words/parameters/return' has methods for the following verbs: get */ + (path: "/special-words/parameters/return"): ParametersWithReturn; + /** Resource for '/special-words/parameters/try' has methods for the following verbs: get */ + (path: "/special-words/parameters/try"): ParametersWithTry; + /** Resource for '/special-words/parameters/while' has methods for the following verbs: get */ + (path: "/special-words/parameters/while"): ParametersWithWhile; + /** Resource for '/special-words/parameters/with' has methods for the following verbs: get */ + (path: "/special-words/parameters/with"): ParametersWithWith; + /** Resource for '/special-words/parameters/yield' has methods for the following verbs: get */ + (path: "/special-words/parameters/yield"): ParametersWithYield; + /** Resource for '/special-words/parameters/cancellationToken' has methods for the following verbs: get */ + ( + path: "/special-words/parameters/cancellationToken" + ): ParametersWithCancellationToken; } export type SpecialWordsClient = Client & { diff --git a/packages/typespec-ts/test/integration/generated/specialWords/src/index.ts b/packages/typespec-ts/test/integration/generated/specialWords/src/index.ts index d95198165e..8047497403 100644 --- a/packages/typespec-ts/test/integration/generated/specialWords/src/index.ts +++ b/packages/typespec-ts/test/integration/generated/specialWords/src/index.ts @@ -8,6 +8,5 @@ export * from "./parameters"; export * from "./responses"; export * from "./clientDefinitions"; export * from "./models"; -export * from "./outputModels"; export default SpecialWordsClient; diff --git a/packages/typespec-ts/test/integration/generated/specialWords/src/models.ts b/packages/typespec-ts/test/integration/generated/specialWords/src/models.ts index fae3f77a40..1d09a8fcd6 100644 --- a/packages/typespec-ts/test/integration/generated/specialWords/src/models.ts +++ b/packages/typespec-ts/test/integration/generated/specialWords/src/models.ts @@ -1,17 +1,138 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -/** This is a base model has discriminator name containing dot. */ -export interface BaseModelParent { - "model.kind": string; +export interface And { + name: string; } -/** This is a model has property names of special words or characters. */ -export interface DerivedModel extends BaseModelParent { - "model.kind": "derived"; - "derived.name": string; - for: string; +export interface As { + name: string; } -/** This is a base model has discriminator name containing dot. */ -export type BaseModel = DerivedModel; +export interface Assert { + name: string; +} + +export interface Async { + name: string; +} + +export interface Await { + name: string; +} + +export interface Break { + name: string; +} + +export interface Class { + name: string; +} + +export interface Constructor { + name: string; +} + +export interface Continue { + name: string; +} + +export interface Def { + name: string; +} + +export interface Del { + name: string; +} + +export interface Elif { + name: string; +} + +export interface Else { + name: string; +} + +export interface Except { + name: string; +} + +export interface Exec { + name: string; +} + +export interface Finally { + name: string; +} + +export interface For { + name: string; +} + +export interface From { + name: string; +} + +export interface Global { + name: string; +} + +export interface If { + name: string; +} + +export interface Import { + name: string; +} + +export interface In { + name: string; +} + +export interface Is { + name: string; +} + +export interface Lambda { + name: string; +} + +export interface Not { + name: string; +} + +export interface Or { + name: string; +} + +export interface Pass { + name: string; +} + +export interface Raise { + name: string; +} + +export interface Return { + name: string; +} + +export interface Try { + name: string; +} + +export interface While { + name: string; +} + +export interface With { + name: string; +} + +export interface Yield { + name: string; +} + +export interface SameAsModel { + SameAsModel: string; +} diff --git a/packages/typespec-ts/test/integration/generated/specialWords/src/outputModels.ts b/packages/typespec-ts/test/integration/generated/specialWords/src/outputModels.ts deleted file mode 100644 index 0899327fd9..0000000000 --- a/packages/typespec-ts/test/integration/generated/specialWords/src/outputModels.ts +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. - -/** This is a base model has discriminator name containing dot. */ -export interface BaseModelOutputParent { - "model.kind": string; -} - -/** This is a model has property names of special words or characters. */ -export interface DerivedModelOutput extends BaseModelOutputParent { - "model.kind": "derived"; - "derived.name": string; - for: string; -} - -/** This is a base model has discriminator name containing dot. */ -export type BaseModelOutput = DerivedModelOutput; diff --git a/packages/typespec-ts/test/integration/generated/specialWords/src/parameters.ts b/packages/typespec-ts/test/integration/generated/specialWords/src/parameters.ts index 0e18fa67f5..2f4c4a46f7 100644 --- a/packages/typespec-ts/test/integration/generated/specialWords/src/parameters.ts +++ b/packages/typespec-ts/test/integration/generated/specialWords/src/parameters.ts @@ -1,37 +1,680 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { RawHttpHeadersInput } from "@azure/core-rest-pipeline"; import { RequestParameters } from "@azure-rest/core-client"; -import { BaseModel } from "./models"; +import { + And, + As, + Assert, + Async, + Await, + Break, + Class, + Constructor, + Continue, + Def, + Del, + Elif, + Else, + Except, + Exec, + Finally, + For, + From, + Global, + If, + Import, + In, + Is, + Lambda, + Not, + Or, + Pass, + Raise, + Return, + Try, + While, + With, + Yield, + SameAsModel, +} from "./models"; -export type OperationForParameters = RequestParameters; +export interface ModelsWithAndBodyParam { + body: And; +} + +export type ModelsWithAndParameters = ModelsWithAndBodyParam & + RequestParameters; + +export interface ModelsWithAsBodyParam { + body: As; +} + +export type ModelsWithAsParameters = ModelsWithAsBodyParam & RequestParameters; + +export interface ModelsWithAssertBodyParam { + body: Assert; +} + +export type ModelsWithAssertParameters = ModelsWithAssertBodyParam & + RequestParameters; + +export interface ModelsWithAsyncBodyParam { + body: Async; +} + +export type ModelsWithAsyncParameters = ModelsWithAsyncBodyParam & + RequestParameters; + +export interface ModelsWithAwaitBodyParam { + body: Await; +} + +export type ModelsWithAwaitParameters = ModelsWithAwaitBodyParam & + RequestParameters; + +export interface ModelsWithBreakBodyParam { + body: Break; +} + +export type ModelsWithBreakParameters = ModelsWithBreakBodyParam & + RequestParameters; + +export interface ModelsWithClassBodyParam { + body: Class; +} + +export type ModelsWithClassParameters = ModelsWithClassBodyParam & + RequestParameters; + +export interface ModelsWithConstructorBodyParam { + body: Constructor; +} + +export type ModelsWithConstructorParameters = ModelsWithConstructorBodyParam & + RequestParameters; + +export interface ModelsWithContinueBodyParam { + body: Continue; +} + +export type ModelsWithContinueParameters = ModelsWithContinueBodyParam & + RequestParameters; + +export interface ModelsWithDefBodyParam { + body: Def; +} + +export type ModelsWithDefParameters = ModelsWithDefBodyParam & + RequestParameters; + +export interface ModelsWithDelBodyParam { + body: Del; +} + +export type ModelsWithDelParameters = ModelsWithDelBodyParam & + RequestParameters; + +export interface ModelsWithElifBodyParam { + body: Elif; +} + +export type ModelsWithElifParameters = ModelsWithElifBodyParam & + RequestParameters; + +export interface ModelsWithElseBodyParam { + body: Else; +} + +export type ModelsWithElseParameters = ModelsWithElseBodyParam & + RequestParameters; + +export interface ModelsWithExceptBodyParam { + body: Except; +} + +export type ModelsWithExceptParameters = ModelsWithExceptBodyParam & + RequestParameters; + +export interface ModelsWithExecBodyParam { + body: Exec; +} + +export type ModelsWithExecParameters = ModelsWithExecBodyParam & + RequestParameters; + +export interface ModelsWithFinallyBodyParam { + body: Finally; +} + +export type ModelsWithFinallyParameters = ModelsWithFinallyBodyParam & + RequestParameters; + +export interface ModelsWithForBodyParam { + body: For; +} + +export type ModelsWithForParameters = ModelsWithForBodyParam & + RequestParameters; + +export interface ModelsWithFromBodyParam { + body: From; +} + +export type ModelsWithFromParameters = ModelsWithFromBodyParam & + RequestParameters; + +export interface ModelsWithGlobalBodyParam { + body: Global; +} + +export type ModelsWithGlobalParameters = ModelsWithGlobalBodyParam & + RequestParameters; + +export interface ModelsWithIfBodyParam { + body: If; +} + +export type ModelsWithIfParameters = ModelsWithIfBodyParam & RequestParameters; + +export interface ModelsWithImportBodyParam { + body: Import; +} + +export type ModelsWithImportParameters = ModelsWithImportBodyParam & + RequestParameters; + +export interface ModelsWithInBodyParam { + body: In; +} + +export type ModelsWithInParameters = ModelsWithInBodyParam & RequestParameters; + +export interface ModelsWithIsBodyParam { + body: Is; +} + +export type ModelsWithIsParameters = ModelsWithIsBodyParam & RequestParameters; + +export interface ModelsWithLambdaBodyParam { + body: Lambda; +} + +export type ModelsWithLambdaParameters = ModelsWithLambdaBodyParam & + RequestParameters; + +export interface ModelsWithNotBodyParam { + body: Not; +} + +export type ModelsWithNotParameters = ModelsWithNotBodyParam & + RequestParameters; + +export interface ModelsWithOrBodyParam { + body: Or; +} + +export type ModelsWithOrParameters = ModelsWithOrBodyParam & RequestParameters; + +export interface ModelsWithPassBodyParam { + body: Pass; +} + +export type ModelsWithPassParameters = ModelsWithPassBodyParam & + RequestParameters; + +export interface ModelsWithRaiseBodyParam { + body: Raise; +} + +export type ModelsWithRaiseParameters = ModelsWithRaiseBodyParam & + RequestParameters; + +export interface ModelsWithReturnBodyParam { + body: Return; +} + +export type ModelsWithReturnParameters = ModelsWithReturnBodyParam & + RequestParameters; + +export interface ModelsWithTryBodyParam { + body: Try; +} + +export type ModelsWithTryParameters = ModelsWithTryBodyParam & + RequestParameters; + +export interface ModelsWithWhileBodyParam { + body: While; +} + +export type ModelsWithWhileParameters = ModelsWithWhileBodyParam & + RequestParameters; + +export interface ModelsWithWithBodyParam { + body: With; +} + +export type ModelsWithWithParameters = ModelsWithWithBodyParam & + RequestParameters; + +export interface ModelsWithYieldBodyParam { + body: Yield; +} + +export type ModelsWithYieldParameters = ModelsWithYieldBodyParam & + RequestParameters; + +export interface ModelPropertiesSameAsModelBodyParam { + body: SameAsModel; +} + +export type ModelPropertiesSameAsModelParameters = + ModelPropertiesSameAsModelBodyParam & RequestParameters; +export type OperationsAndParameters = RequestParameters; +export type OperationsAsParameters = RequestParameters; +export type OperationsAssertParameters = RequestParameters; +export type OperationsAsyncParameters = RequestParameters; +export type OperationsAwaitParameters = RequestParameters; +export type OperationsBreakParameters = RequestParameters; +export type OperationsClassParameters = RequestParameters; +export type OperationsConstructorParameters = RequestParameters; +export type OperationsContinueParameters = RequestParameters; +export type OperationsDefParameters = RequestParameters; +export type OperationsDelParameters = RequestParameters; +export type OperationsElifParameters = RequestParameters; +export type OperationsElseParameters = RequestParameters; +export type OperationsExceptParameters = RequestParameters; +export type OperationsExecParameters = RequestParameters; +export type OperationsFinallyParameters = RequestParameters; +export type OperationsForParameters = RequestParameters; +export type OperationsFromParameters = RequestParameters; +export type OperationsGlobalParameters = RequestParameters; +export type OperationsIfParameters = RequestParameters; +export type OperationsImportParameters = RequestParameters; +export type OperationsInParameters = RequestParameters; +export type OperationsIsParameters = RequestParameters; +export type OperationsLambdaParameters = RequestParameters; +export type OperationsNotParameters = RequestParameters; +export type OperationsOrParameters = RequestParameters; +export type OperationsPassParameters = RequestParameters; +export type OperationsRaiseParameters = RequestParameters; +export type OperationsReturnParameters = RequestParameters; +export type OperationsTryParameters = RequestParameters; +export type OperationsWhileParameters = RequestParameters; +export type OperationsWithParameters = RequestParameters; +export type OperationsYieldParameters = RequestParameters; + +export interface ParametersWithAndQueryParamProperties { + and: string; +} + +export interface ParametersWithAndQueryParam { + queryParameters: ParametersWithAndQueryParamProperties; +} + +export type ParametersWithAndParameters = ParametersWithAndQueryParam & + RequestParameters; + +export interface ParametersWithAsQueryParamProperties { + as: string; +} + +export interface ParametersWithAsQueryParam { + queryParameters: ParametersWithAsQueryParamProperties; +} + +export type ParametersWithAsParameters = ParametersWithAsQueryParam & + RequestParameters; + +export interface ParametersWithAssertQueryParamProperties { + assert: string; +} + +export interface ParametersWithAssertQueryParam { + queryParameters: ParametersWithAssertQueryParamProperties; +} + +export type ParametersWithAssertParameters = ParametersWithAssertQueryParam & + RequestParameters; + +export interface ParametersWithAsyncQueryParamProperties { + async: string; +} + +export interface ParametersWithAsyncQueryParam { + queryParameters: ParametersWithAsyncQueryParamProperties; +} + +export type ParametersWithAsyncParameters = ParametersWithAsyncQueryParam & + RequestParameters; + +export interface ParametersWithAwaitQueryParamProperties { + await: string; +} + +export interface ParametersWithAwaitQueryParam { + queryParameters: ParametersWithAwaitQueryParamProperties; +} + +export type ParametersWithAwaitParameters = ParametersWithAwaitQueryParam & + RequestParameters; + +export interface ParametersWithBreakQueryParamProperties { + break: string; +} + +export interface ParametersWithBreakQueryParam { + queryParameters: ParametersWithBreakQueryParamProperties; +} + +export type ParametersWithBreakParameters = ParametersWithBreakQueryParam & + RequestParameters; + +export interface ParametersWithClassQueryParamProperties { + class: string; +} + +export interface ParametersWithClassQueryParam { + queryParameters: ParametersWithClassQueryParamProperties; +} + +export type ParametersWithClassParameters = ParametersWithClassQueryParam & + RequestParameters; + +export interface ParametersWithConstructorQueryParamProperties { + constructor: string; +} + +export interface ParametersWithConstructorQueryParam { + queryParameters: ParametersWithConstructorQueryParamProperties; +} + +export type ParametersWithConstructorParameters = + ParametersWithConstructorQueryParam & RequestParameters; + +export interface ParametersWithContinueQueryParamProperties { + continue: string; +} + +export interface ParametersWithContinueQueryParam { + queryParameters: ParametersWithContinueQueryParamProperties; +} + +export type ParametersWithContinueParameters = + ParametersWithContinueQueryParam & RequestParameters; + +export interface ParametersWithDefQueryParamProperties { + def: string; +} + +export interface ParametersWithDefQueryParam { + queryParameters: ParametersWithDefQueryParamProperties; +} + +export type ParametersWithDefParameters = ParametersWithDefQueryParam & + RequestParameters; + +export interface ParametersWithDelQueryParamProperties { + del: string; +} + +export interface ParametersWithDelQueryParam { + queryParameters: ParametersWithDelQueryParamProperties; +} + +export type ParametersWithDelParameters = ParametersWithDelQueryParam & + RequestParameters; + +export interface ParametersWithElifQueryParamProperties { + elif: string; +} + +export interface ParametersWithElifQueryParam { + queryParameters: ParametersWithElifQueryParamProperties; +} + +export type ParametersWithElifParameters = ParametersWithElifQueryParam & + RequestParameters; + +export interface ParametersWithElseQueryParamProperties { + else: string; +} + +export interface ParametersWithElseQueryParam { + queryParameters: ParametersWithElseQueryParamProperties; +} + +export type ParametersWithElseParameters = ParametersWithElseQueryParam & + RequestParameters; + +export interface ParametersWithExceptQueryParamProperties { + except: string; +} + +export interface ParametersWithExceptQueryParam { + queryParameters: ParametersWithExceptQueryParamProperties; +} + +export type ParametersWithExceptParameters = ParametersWithExceptQueryParam & + RequestParameters; + +export interface ParametersWithExecQueryParamProperties { + exec: string; +} + +export interface ParametersWithExecQueryParam { + queryParameters: ParametersWithExecQueryParamProperties; +} + +export type ParametersWithExecParameters = ParametersWithExecQueryParam & + RequestParameters; + +export interface ParametersWithFinallyQueryParamProperties { + finally: string; +} + +export interface ParametersWithFinallyQueryParam { + queryParameters: ParametersWithFinallyQueryParamProperties; +} + +export type ParametersWithFinallyParameters = ParametersWithFinallyQueryParam & + RequestParameters; + +export interface ParametersWithForQueryParamProperties { + for: string; +} + +export interface ParametersWithForQueryParam { + queryParameters: ParametersWithForQueryParamProperties; +} + +export type ParametersWithForParameters = ParametersWithForQueryParam & + RequestParameters; + +export interface ParametersWithFromQueryParamProperties { + from: string; +} + +export interface ParametersWithFromQueryParam { + queryParameters: ParametersWithFromQueryParamProperties; +} + +export type ParametersWithFromParameters = ParametersWithFromQueryParam & + RequestParameters; + +export interface ParametersWithGlobalQueryParamProperties { + global: string; +} -export interface ParameterGetWithIfHeaders { +export interface ParametersWithGlobalQueryParam { + queryParameters: ParametersWithGlobalQueryParamProperties; +} + +export type ParametersWithGlobalParameters = ParametersWithGlobalQueryParam & + RequestParameters; + +export interface ParametersWithIfQueryParamProperties { if: string; } -export interface ParameterGetWithIfHeaderParam { - headers: RawHttpHeadersInput & ParameterGetWithIfHeaders; +export interface ParametersWithIfQueryParam { + queryParameters: ParametersWithIfQueryParamProperties; +} + +export type ParametersWithIfParameters = ParametersWithIfQueryParam & + RequestParameters; + +export interface ParametersWithImportQueryParamProperties { + import: string; +} + +export interface ParametersWithImportQueryParam { + queryParameters: ParametersWithImportQueryParamProperties; +} + +export type ParametersWithImportParameters = ParametersWithImportQueryParam & + RequestParameters; + +export interface ParametersWithInQueryParamProperties { + in: string; +} + +export interface ParametersWithInQueryParam { + queryParameters: ParametersWithInQueryParamProperties; +} + +export type ParametersWithInParameters = ParametersWithInQueryParam & + RequestParameters; + +export interface ParametersWithIsQueryParamProperties { + is: string; +} + +export interface ParametersWithIsQueryParam { + queryParameters: ParametersWithIsQueryParamProperties; +} + +export type ParametersWithIsParameters = ParametersWithIsQueryParam & + RequestParameters; + +export interface ParametersWithLambdaQueryParamProperties { + lambda: string; +} + +export interface ParametersWithLambdaQueryParam { + queryParameters: ParametersWithLambdaQueryParamProperties; +} + +export type ParametersWithLambdaParameters = ParametersWithLambdaQueryParam & + RequestParameters; + +export interface ParametersWithNotQueryParamProperties { + not: string; +} + +export interface ParametersWithNotQueryParam { + queryParameters: ParametersWithNotQueryParamProperties; +} + +export type ParametersWithNotParameters = ParametersWithNotQueryParam & + RequestParameters; + +export interface ParametersWithOrQueryParamProperties { + or: string; +} + +export interface ParametersWithOrQueryParam { + queryParameters: ParametersWithOrQueryParamProperties; } -export type ParameterGetWithIfParameters = ParameterGetWithIfHeaderParam & +export type ParametersWithOrParameters = ParametersWithOrQueryParam & RequestParameters; -export interface ParameterGetWithFilterQueryParamProperties { - filter: string; +export interface ParametersWithPassQueryParamProperties { + pass: string; } -export interface ParameterGetWithFilterQueryParam { - queryParameters: ParameterGetWithFilterQueryParamProperties; +export interface ParametersWithPassQueryParam { + queryParameters: ParametersWithPassQueryParamProperties; } -export type ParameterGetWithFilterParameters = - ParameterGetWithFilterQueryParam & RequestParameters; -export type ModelGetParameters = RequestParameters; +export type ParametersWithPassParameters = ParametersWithPassQueryParam & + RequestParameters; + +export interface ParametersWithRaiseQueryParamProperties { + raise: string; +} + +export interface ParametersWithRaiseQueryParam { + queryParameters: ParametersWithRaiseQueryParamProperties; +} + +export type ParametersWithRaiseParameters = ParametersWithRaiseQueryParam & + RequestParameters; + +export interface ParametersWithReturnQueryParamProperties { + return: string; +} + +export interface ParametersWithReturnQueryParam { + queryParameters: ParametersWithReturnQueryParamProperties; +} + +export type ParametersWithReturnParameters = ParametersWithReturnQueryParam & + RequestParameters; + +export interface ParametersWithTryQueryParamProperties { + try: string; +} + +export interface ParametersWithTryQueryParam { + queryParameters: ParametersWithTryQueryParamProperties; +} + +export type ParametersWithTryParameters = ParametersWithTryQueryParam & + RequestParameters; + +export interface ParametersWithWhileQueryParamProperties { + while: string; +} + +export interface ParametersWithWhileQueryParam { + queryParameters: ParametersWithWhileQueryParamProperties; +} + +export type ParametersWithWhileParameters = ParametersWithWhileQueryParam & + RequestParameters; + +export interface ParametersWithWithQueryParamProperties { + with: string; +} + +export interface ParametersWithWithQueryParam { + queryParameters: ParametersWithWithQueryParamProperties; +} + +export type ParametersWithWithParameters = ParametersWithWithQueryParam & + RequestParameters; + +export interface ParametersWithYieldQueryParamProperties { + yield: string; +} + +export interface ParametersWithYieldQueryParam { + queryParameters: ParametersWithYieldQueryParamProperties; +} + +export type ParametersWithYieldParameters = ParametersWithYieldQueryParam & + RequestParameters; + +export interface ParametersWithCancellationTokenQueryParamProperties { + cancellationToken: string; +} -export interface ModelPutBodyParam { - body: BaseModel; +export interface ParametersWithCancellationTokenQueryParam { + queryParameters: ParametersWithCancellationTokenQueryParamProperties; } -export type ModelPutParameters = ModelPutBodyParam & RequestParameters; +export type ParametersWithCancellationTokenParameters = + ParametersWithCancellationTokenQueryParam & RequestParameters; diff --git a/packages/typespec-ts/test/integration/generated/specialWords/src/responses.ts b/packages/typespec-ts/test/integration/generated/specialWords/src/responses.ts index 68d73f3bb1..1dc5cb1660 100644 --- a/packages/typespec-ts/test/integration/generated/specialWords/src/responses.ts +++ b/packages/typespec-ts/test/integration/generated/specialWords/src/responses.ts @@ -2,30 +2,509 @@ // Licensed under the MIT license. import { HttpResponse } from "@azure-rest/core-client"; -import { BaseModelOutput } from "./outputModels"; /** There is no content to send for this request, but the headers may be useful. */ -export interface OperationFor204Response extends HttpResponse { +export interface ModelsWithAnd204Response extends HttpResponse { status: "204"; } /** There is no content to send for this request, but the headers may be useful. */ -export interface ParameterGetWithIf204Response extends HttpResponse { +export interface ModelsWithAs204Response extends HttpResponse { status: "204"; } /** There is no content to send for this request, but the headers may be useful. */ -export interface ParameterGetWithFilter204Response extends HttpResponse { +export interface ModelsWithAssert204Response extends HttpResponse { status: "204"; } -/** The request has succeeded. */ -export interface ModelGet200Response extends HttpResponse { - status: "200"; - body: BaseModelOutput; +/** There is no content to send for this request, but the headers may be useful. */ +export interface ModelsWithAsync204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface ModelsWithAwait204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface ModelsWithBreak204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface ModelsWithClass204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface ModelsWithConstructor204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface ModelsWithContinue204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface ModelsWithDef204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface ModelsWithDel204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface ModelsWithElif204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface ModelsWithElse204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface ModelsWithExcept204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface ModelsWithExec204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface ModelsWithFinally204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface ModelsWithFor204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface ModelsWithFrom204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface ModelsWithGlobal204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface ModelsWithIf204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface ModelsWithImport204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface ModelsWithIn204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface ModelsWithIs204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface ModelsWithLambda204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface ModelsWithNot204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface ModelsWithOr204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface ModelsWithPass204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface ModelsWithRaise204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface ModelsWithReturn204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface ModelsWithTry204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface ModelsWithWhile204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface ModelsWithWith204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface ModelsWithYield204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface ModelPropertiesSameAsModel204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface OperationsAnd204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface OperationsAs204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface OperationsAssert204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface OperationsAsync204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface OperationsAwait204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface OperationsBreak204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface OperationsClass204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface OperationsConstructor204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface OperationsContinue204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface OperationsDef204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface OperationsDel204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface OperationsElif204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface OperationsElse204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface OperationsExcept204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface OperationsExec204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface OperationsFinally204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface OperationsFor204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface OperationsFrom204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface OperationsGlobal204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface OperationsIf204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface OperationsImport204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface OperationsIn204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface OperationsIs204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface OperationsLambda204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface OperationsNot204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface OperationsOr204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface OperationsPass204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface OperationsRaise204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface OperationsReturn204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface OperationsTry204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface OperationsWhile204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface OperationsWith204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface OperationsYield204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface ParametersWithAnd204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface ParametersWithAs204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface ParametersWithAssert204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface ParametersWithAsync204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface ParametersWithAwait204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface ParametersWithBreak204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface ParametersWithClass204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface ParametersWithConstructor204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface ParametersWithContinue204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface ParametersWithDef204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface ParametersWithDel204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface ParametersWithElif204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface ParametersWithElse204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface ParametersWithExcept204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface ParametersWithExec204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface ParametersWithFinally204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface ParametersWithFor204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface ParametersWithFrom204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface ParametersWithGlobal204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface ParametersWithIf204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface ParametersWithImport204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface ParametersWithIn204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface ParametersWithIs204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface ParametersWithLambda204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface ParametersWithNot204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface ParametersWithOr204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface ParametersWithPass204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface ParametersWithRaise204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface ParametersWithReturn204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface ParametersWithTry204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface ParametersWithWhile204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface ParametersWithWith204Response extends HttpResponse { + status: "204"; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface ParametersWithYield204Response extends HttpResponse { + status: "204"; } /** There is no content to send for this request, but the headers may be useful. */ -export interface ModelPut204Response extends HttpResponse { +export interface ParametersWithCancellationToken204Response + extends HttpResponse { status: "204"; } diff --git a/packages/typespec-ts/test/integration/internal.spec.ts b/packages/typespec-ts/test/integration/internal.spec.ts deleted file mode 100644 index 844c4e0f18..0000000000 --- a/packages/typespec-ts/test/integration/internal.spec.ts +++ /dev/null @@ -1,76 +0,0 @@ -import { assert } from "chai"; -import InternalClientFactory, { - InternalClient -} from "./generated/internal/src/index.js"; -describe("Internal Rest Client", () => { - let client: InternalClient; - - beforeEach(() => { - client = InternalClientFactory({ - allowInsecureConnection: true, - retryOptions: { - maxRetries: 0 - } - }); - }); - - it("should get internal only", async () => { - try { - const result = await client - .path("/azure/client-generator-core/internal/internal") - .get({ - queryParameters: { - name: "any" - } - }); - assert.strictEqual(result.status, "200"); - } catch (err) { - assert.fail(err as string); - } - }); - - it("should get internal", async () => { - try { - const result = await client - .path("/azure/client-generator-core/internal/public") - .get({ - queryParameters: { - name: "any" - } - }); - assert.strictEqual(result.status, "200"); - } catch (err) { - assert.fail(err as string); - } - }); - - it("should get shared public", async () => { - try { - const result = await client - .path("/azure/client-generator-core/internal/shared/public") - .get({ - queryParameters: { - name: "any" - } - }); - assert.strictEqual(result.status, "200"); - } catch (err) { - assert.fail(err as string); - } - }); - - it("should get shared internal", async () => { - try { - const result = await client - .path("/azure/client-generator-core/internal/shared/internal") - .get({ - queryParameters: { - name: "any" - } - }); - assert.strictEqual(result.status, "200"); - } catch (err) { - assert.fail(err as string); - } - }); -}); diff --git a/packages/typespec-ts/test/integration/specialWords.spec.ts b/packages/typespec-ts/test/integration/specialWords.spec.ts index a47aa98b32..1df397ab32 100644 --- a/packages/typespec-ts/test/integration/specialWords.spec.ts +++ b/packages/typespec-ts/test/integration/specialWords.spec.ts @@ -1,73 +1,1207 @@ import SpecialWordsClientFactory, { - DerivedModel, SpecialWordsClient } from "./generated/specialWords/src/index.js"; import { assert } from "chai"; -describe("HelloClient Rest Client", () => { +describe("SpecialWordsClient Rest Client", () => { let client: SpecialWordsClient; - const modelValue: DerivedModel = { - "model.kind": "derived", - "derived.name": "my.name", - for: "value" - }; beforeEach(() => { client = SpecialWordsClientFactory({ allowInsecureConnection: true }); }); - it("should get special words for operation `for`", async () => { - try { - const result = await client.path("/special-words/operation/for").get(); - assert.strictEqual(result.status, "204"); - } catch (err) { - assert.fail(err as string); - } - }); + describe("operations", () => { + it("should get special words for operation `for`", async () => { + try { + const result = await client.path("/special-words/operations/for").get(); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); - it("should get special words for parameter `if`", async () => { - try { - const result = await client.path("/special-words/parameter/if").get({ - headers: { - if: "weekend" - } - }); - assert.strictEqual(result.status, "204"); - } catch (err) { - assert.fail(err as string); - } - }); + it("should get special words for operation `and`", async () => { + try { + const result = await client.path("/special-words/operations/and").get(); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + + it("should get special words for operation `as`", async () => { + try { + const result = await client.path("/special-words/operations/as").get(); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + + it("should get special words for operation `assert`", async () => { + try { + const result = await client + .path("/special-words/operations/assert") + .get(); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + + it("should get special words for operation `async`", async () => { + try { + const result = await client + .path("/special-words/operations/async") + .get(); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + + it("should get special words for operation `await`", async () => { + try { + const result = await client + .path("/special-words/operations/await") + .get(); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + + it("should get special words for operation `break`", async () => { + try { + const result = await client + .path("/special-words/operations/break") + .get(); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + + it("should get special words for operation `class`", async () => { + try { + const result = await client + .path("/special-words/operations/class") + .get(); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + + it("should get special words for operation `constructor`", async () => { + try { + const result = await client + .path("/special-words/operations/constructor") + .get(); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + + it("should get special words for operation `continue`", async () => { + try { + const result = await client + .path("/special-words/operations/continue") + .get(); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + + it("should get special words for operation `def`", async () => { + try { + const result = await client.path("/special-words/operations/def").get(); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + + it("should get special words for operation `elif`", async () => { + try { + const result = await client + .path("/special-words/operations/elif") + .get(); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + + it("should get special words for operation `else`", async () => { + try { + const result = await client + .path("/special-words/operations/else") + .get(); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); - it("should get special words for parameter `filter`", async () => { - try { - const result = await client.path("/special-words/parameter/filter").get({ - queryParameters: { - filter: "abc*." - } - }); - assert.strictEqual(result.status, "204"); - } catch (err) { - assert.fail(err as string); - } + it("should get special words for operation `except`", async () => { + try { + const result = await client + .path("/special-words/operations/except") + .get(); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + + it("should get special words for operation `exec`", async () => { + try { + const result = await client + .path("/special-words/operations/exec") + .get(); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + it("should get special words for operation `finally`", async () => { + try { + const result = await client + .path("/special-words/operations/finally") + .get(); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + it("should get special words for operation `for`", async () => { + try { + const result = await client.path("/special-words/operations/for").get(); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + it("should get special words for operation `from`", async () => { + try { + const result = await client + .path("/special-words/operations/from") + .get(); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + it("should get special words for operation `global`", async () => { + try { + const result = await client + .path("/special-words/operations/global") + .get(); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + it("should get special words for operation `if`", async () => { + try { + const result = await client.path("/special-words/operations/if").get(); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + it("should get special words for operation `import`", async () => { + try { + const result = await client + .path("/special-words/operations/import") + .get(); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + it("should get special words for operation `in`", async () => { + try { + const result = await client.path("/special-words/operations/in").get(); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + it("should get special words for operation `is`", async () => { + try { + const result = await client.path("/special-words/operations/is").get(); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + it("should get special words for operation `lambda`", async () => { + try { + const result = await client + .path("/special-words/operations/lambda") + .get(); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + it("should get special words for operation `not`", async () => { + try { + const result = await client.path("/special-words/operations/not").get(); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + it("should get special words for operation `or`", async () => { + try { + const result = await client.path("/special-words/operations/or").get(); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + it("should get special words for operation `pass`", async () => { + try { + const result = await client + .path("/special-words/operations/pass") + .get(); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + + it("should get special words for operation `raise`", async () => { + try { + const result = await client + .path("/special-words/operations/raise") + .get(); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + it("should get special words for operation `return`", async () => { + try { + const result = await client + .path("/special-words/operations/return") + .get(); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + + it("should get special words for operation `try`", async () => { + try { + const result = await client.path("/special-words/operations/try").get(); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + it("should get special words for operation `while`", async () => { + try { + const result = await client + .path("/special-words/operations/while") + .get(); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + + it("should get special words for operation `with`", async () => { + try { + const result = await client + .path("/special-words/operations/with") + .get(); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + it("should get special words for operation `yield`", async () => { + try { + const result = await client + .path("/special-words/operations/yield") + .get(); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); }); - it("should get special words for model", async () => { - try { - const result = await client.path("/special-words/model/get").get(); - assert.strictEqual(result.status, "200"); - assert.deepEqual(result.body, modelValue); - } catch (err) { - assert.fail(err as string); - } + describe("parameters", () => { + it("should get special words for operation `for`", async () => { + try { + const result = await client.path("/special-words/parameters/for").get({ + queryParameters: { + for: "ok" + } + }); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + + it("should get special words for operation `and`", async () => { + try { + const result = await client.path("/special-words/parameters/and").get({ + queryParameters: { + and: "ok" + } + }); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + + it("should get special words for operation `as`", async () => { + try { + const result = await client.path("/special-words/parameters/as").get({ + queryParameters: { + as: "ok" + } + }); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + + it("should get special words for operation `assert`", async () => { + try { + const result = await client + .path("/special-words/parameters/assert") + .get({ + queryParameters: { + assert: "ok" + } + }); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + + it("should get special words for operation `async`", async () => { + try { + const result = await client + .path("/special-words/parameters/async") + .get({ + queryParameters: { + async: "ok" + } + }); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + + it("should get special words for operation `await`", async () => { + try { + const result = await client + .path("/special-words/parameters/await") + .get({ + queryParameters: { + await: "ok" + } + }); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + + it("should get special words for operation `break`", async () => { + try { + const result = await client + .path("/special-words/parameters/break") + .get({ + queryParameters: { + break: "ok" + } + }); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + + it("should get special words for operation `class`", async () => { + try { + const result = await client + .path("/special-words/parameters/class") + .get({ + queryParameters: { + class: "ok" + } + }); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + + it("should get special words for operation `constructor`", async () => { + try { + const result = await client + .path("/special-words/parameters/constructor") + .get({ + queryParameters: { + constructor: "ok" as any + } + }); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + + it("should get special words for operation `continue`", async () => { + try { + const result = await client + .path("/special-words/parameters/continue") + .get({ + queryParameters: { + continue: "ok" + } + }); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + + it("should get special words for operation `def`", async () => { + try { + const result = await client.path("/special-words/parameters/def").get({ + queryParameters: { + def: "ok" + } + }); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + + it("should get special words for operation `elif`", async () => { + try { + const result = await client.path("/special-words/parameters/elif").get({ + queryParameters: { + elif: "ok" + } + }); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + + it("should get special words for operation `else`", async () => { + try { + const result = await client.path("/special-words/parameters/else").get({ + queryParameters: { + else: "ok" + } + }); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + + it("should get special words for operation `except`", async () => { + try { + const result = await client + .path("/special-words/parameters/except") + .get({ + queryParameters: { + except: "ok" + } + }); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + + it("should get special words for operation `exec`", async () => { + try { + const result = await client.path("/special-words/parameters/exec").get({ + queryParameters: { + exec: "ok" + } + }); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + it("should get special words for operation `finally`", async () => { + try { + const result = await client + .path("/special-words/parameters/finally") + .get({ + queryParameters: { + finally: "ok" + } + }); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + it("should get special words for operation `for`", async () => { + try { + const result = await client.path("/special-words/parameters/for").get({ + queryParameters: { + for: "ok" + } + }); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + it("should get special words for operation `from`", async () => { + try { + const result = await client.path("/special-words/parameters/from").get({ + queryParameters: { + from: "ok" + } + }); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + it("should get special words for operation `global`", async () => { + try { + const result = await client + .path("/special-words/parameters/global") + .get({ + queryParameters: { + global: "ok" + } + }); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + it("should get special words for operation `if`", async () => { + try { + const result = await client.path("/special-words/parameters/if").get({ + queryParameters: { + if: "ok" + } + }); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + it("should get special words for operation `import`", async () => { + try { + const result = await client + .path("/special-words/parameters/import") + .get({ + queryParameters: { + import: "ok" + } + }); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + it("should get special words for operation `in`", async () => { + try { + const result = await client.path("/special-words/parameters/in").get({ + queryParameters: { + in: "ok" + } + }); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + it("should get special words for operation `is`", async () => { + try { + const result = await client.path("/special-words/parameters/is").get({ + queryParameters: { + is: "ok" + } + }); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + it("should get special words for operation `lambda`", async () => { + try { + const result = await client + .path("/special-words/parameters/lambda") + .get({ + queryParameters: { + lambda: "ok" + } + }); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + it("should get special words for operation `not`", async () => { + try { + const result = await client.path("/special-words/parameters/not").get({ + queryParameters: { + not: "ok" + } + }); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + it("should get special words for operation `or`", async () => { + try { + const result = await client.path("/special-words/parameters/or").get({ + queryParameters: { + or: "ok" + } + }); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + it("should get special words for operation `pass`", async () => { + try { + const result = await client.path("/special-words/parameters/pass").get({ + queryParameters: { + pass: "ok" + } + }); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + + it("should get special words for operation `raise`", async () => { + try { + const result = await client + .path("/special-words/parameters/raise") + .get({ + queryParameters: { + raise: "ok" + } + }); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + it("should get special words for operation `return`", async () => { + try { + const result = await client + .path("/special-words/parameters/return") + .get({ + queryParameters: { + return: "ok" + } + }); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + + it("should get special words for operation `try`", async () => { + try { + const result = await client.path("/special-words/parameters/try").get({ + queryParameters: { + try: "ok" + } + }); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + it("should get special words for operation `while`", async () => { + try { + const result = await client + .path("/special-words/parameters/while") + .get({ + queryParameters: { + while: "ok" + } + }); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + + it("should get special words for operation `with`", async () => { + try { + const result = await client.path("/special-words/parameters/with").get({ + queryParameters: { + with: "ok" + } + }); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + it("should get special words for operation `yield`", async () => { + try { + const result = await client + .path("/special-words/parameters/yield") + .get({ + queryParameters: { + yield: "ok" + } + }); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); }); - it("should put special words for model", async () => { - try { - const result = await client.path("/special-words/model/put").put({ - body: modelValue - }); - assert.strictEqual(result.status, "204"); - } catch (err) { - assert.fail(err as string); - } + describe("models", () => { + it("should get special words for operation `for`", async () => { + try { + const result = await client.path("/special-words/models/for").post({ + body: { + name: "ok" + } + }); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + + it("should get special words for operation `and`", async () => { + try { + const result = await client.path("/special-words/models/and").post({ + body: { + name: "ok" + } + }); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + + it("should get special words for operation `as`", async () => { + try { + const result = await client.path("/special-words/models/as").post({ + body: { + name: "ok" + } + }); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + + it("should get special words for operation `assert`", async () => { + try { + const result = await client.path("/special-words/models/assert").post({ + body: { + name: "ok" + } + }); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + + it("should get special words for operation `async`", async () => { + try { + const result = await client.path("/special-words/models/async").post({ + body: { + name: "ok" + } + }); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + + it("should get special words for operation `await`", async () => { + try { + const result = await client.path("/special-words/models/await").post({ + body: { + name: "ok" + } + }); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + + it("should get special words for operation `break`", async () => { + try { + const result = await client.path("/special-words/models/break").post({ + body: { + name: "ok" + } + }); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + + it("should get special words for operation `class`", async () => { + try { + const result = await client.path("/special-words/models/class").post({ + body: { + name: "ok" + } + }); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + + it("should get special words for operation `constructor`", async () => { + try { + const result = await client + .path("/special-words/models/constructor") + .post({ + body: { + name: "ok" + } + }); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + + it("should get special words for operation `continue`", async () => { + try { + const result = await client + .path("/special-words/models/continue") + .post({ + body: { + name: "ok" + } + }); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + + it("should get special words for operation `def`", async () => { + try { + const result = await client.path("/special-words/models/def").post({ + body: { + name: "ok" + } + }); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + + it("should get special words for operation `elif`", async () => { + try { + const result = await client.path("/special-words/models/elif").post({ + body: { + name: "ok" + } + }); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + + it("should get special words for operation `else`", async () => { + try { + const result = await client.path("/special-words/models/else").post({ + body: { + name: "ok" + } + }); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + + it("should get special words for operation `except`", async () => { + try { + const result = await client.path("/special-words/models/except").post({ + body: { + name: "ok" + } + }); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + + it("should get special words for operation `exec`", async () => { + try { + const result = await client.path("/special-words/models/exec").post({ + body: { + name: "ok" + } + }); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + it("should get special words for operation `finally`", async () => { + try { + const result = await client.path("/special-words/models/finally").post({ + body: { + name: "ok" + } + }); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + it("should get special words for operation `for`", async () => { + try { + const result = await client.path("/special-words/models/for").post({ + body: { + name: "ok" + } + }); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + it("should get special words for operation `from`", async () => { + try { + const result = await client.path("/special-words/models/from").post({ + body: { + name: "ok" + } + }); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + it("should get special words for operation `global`", async () => { + try { + const result = await client.path("/special-words/models/global").post({ + body: { + name: "ok" + } + }); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + it("should get special words for operation `if`", async () => { + try { + const result = await client.path("/special-words/models/if").post({ + body: { + name: "ok" + } + }); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + it("should get special words for operation `import`", async () => { + try { + const result = await client.path("/special-words/models/import").post({ + body: { + name: "ok" + } + }); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + it("should get special words for operation `in`", async () => { + try { + const result = await client.path("/special-words/models/in").post({ + body: { + name: "ok" + } + }); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + it("should get special words for operation `is`", async () => { + try { + const result = await client.path("/special-words/models/is").post({ + body: { + name: "ok" + } + }); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + it("should get special words for operation `lambda`", async () => { + try { + const result = await client.path("/special-words/models/lambda").post({ + body: { + name: "ok" + } + }); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + it("should get special words for operation `not`", async () => { + try { + const result = await client.path("/special-words/models/not").post({ + body: { + name: "ok" + } + }); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + it("should get special words for operation `or`", async () => { + try { + const result = await client.path("/special-words/models/or").post({ + body: { + name: "ok" + } + }); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + it("should get special words for operation `pass`", async () => { + try { + const result = await client.path("/special-words/models/pass").post({ + body: { + name: "ok" + } + }); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + + it("should get special words for operation `raise`", async () => { + try { + const result = await client.path("/special-words/models/raise").post({ + body: { + name: "ok" + } + }); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + it("should get special words for operation `return`", async () => { + try { + const result = await client.path("/special-words/models/return").post({ + body: { + name: "ok" + } + }); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + + it("should get special words for operation `try`", async () => { + try { + const result = await client.path("/special-words/models/try").post({ + body: { + name: "ok" + } + }); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + it("should get special words for operation `while`", async () => { + try { + const result = await client.path("/special-words/models/while").post({ + body: { + name: "ok" + } + }); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + + it("should get special words for operation `with`", async () => { + try { + const result = await client.path("/special-words/models/with").post({ + body: { + name: "ok" + } + }); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); + it("should get special words for operation `yield`", async () => { + try { + const result = await client.path("/special-words/models/yield").post({ + body: { + name: "ok" + } + }); + assert.strictEqual(result.status, "204"); + } catch (err) { + assert.fail(err as string); + } + }); }); });